This code doesn't convert a byte array to a variant list. It simply adds the byte array to a variant list in a very complicated way.
This code doesn't convert a byte array to a variant list. It simply adds the byte array to a variant list in a very complicated way.
I don't know what you have to do. I don't know what the byte array contains. I'm merely stating the fact that you are not converting anything, just adding it to a list.
Wysota the bytearray contains the fingerprint data.I stored the fingerdata in a QByteArray.
The routine that I call with dinamicCall wants as second argument ( argument 1 as you told ) a QVariantList fingerData so I suppose that I have to convert from QByteArray to QVariantList to pass such variantlist to the routine that I call with dinamicCall.
I'm unable to perform such conversion so I hope you can help me doing it.
Kind Regards
Franco Amato
I can't help you because I don't know what the call expects. Contact the authors of the DLL and ask them. Nobody here will be able to guess what the contents of the list should be just by looking at the function name.
I already contacted the author and it gave to me a doc containing the routines list.
The routine I have to call is named.RegUserData
I list here the parameters wanted by such routine:
The param that give problems to me is the last: FingerData, that should be an array of bytes nothing more.CardID(string/10)
OverWrite(0: no overwrite. If ID is already registered, return with result 06.,1: overwrite.)
idxDesignation
idxDepartment
FirstName(string /15)
LastName(string /15)
idxGroup (integer/0~255)
Status(1: Activate, 0: Deactivate)
WorkMode(0:finger+pass ,1:finger,2ass,3:finger or pass,4:Only Crad,5:Only from external Reader,6:Matching on Mifare card)
WorkTimeStart()
WorkTimeEnd()
EmployeeID
RegisterMode( Finger =1, Password = 2, Finger and Password = 3, Card=4, Max=4)
CheckExpire
ExpireDateStart
ExpireDateEnd
Password(string/10)
NF(Number of fingerprint data per user Max. 2)
TemplateSize
FingerData (byte,User Fingerprint data total size depends on the number of fingerprints registered per user)
When I generated the documentation with dumpcpp it says that I have to pass FingerData as QVariantList and here is where I would have your help.
Thanx in advance.
Franco Amato
This is the output of generateDocumentation:
Qt Code:
bool RegUserData(QString CardID, QVariantList FingerData, bool OverWrite = 0, int idxDesignation = 0, int idxDepartment = 0, QString FirstName = 0, QString LastName = 0, int idxGroup = 0, bool Status = 0, int WorkMode = 0, QString WorkTimeStart = 0, QString WorkTimeEnd = 0, QString EmployeeID = 0, int RegisterMode = 0, bool CheckExpire = 0, QDateTime ExpireDateStart = 0, QDateTime ExpireDateEnd = 0, QString Password = 0, int NF = 0, int TemplateSize = 0);To copy to clipboard, switch view to plain text mode
You can see that it ask for FingerData as second param and of type QVariantList.
Franco Amato
Well I think Qt can not solve this problem.
I have to implement it in C#
Franco Amato
I'm sure it can, you just can't blindly do different things hoping that one thing you try might be the correct one. You need to read some documentation, maybe browse and analyze some code and develop a solution to your problem. You won't be given an answer on a silver platter.
I would guess (but only guess) the argument in question awaits a list of byte arrays where each byte array corresponds to a single fingerprint data. But again, that's just a guess based on some logical deduction.
Wysota I don't want a solution on a silver plate. I only would convert a QByteArray to a QVariantList because I'm not able to do it. I tried many ways without success.
And yes the the argument in question awaits a list of byte arrays where each byte array corresponds to a single fingerprint data. This device store a fingerprint with 352 bytes so my QByteArray has 352 elements and I would convert this 352 elements of my QByteArray to a QVariantList.
Best
Franco Amato
Because you first have to know what result you want to achieve before "trying many ways".
And how do you know that? Maybe it expects the number of byte arrays in the first cell of the list?And yes the the argument in question awaits a list of byte arrays where each byte array corresponds to a single fingerprint data.
No, the number of byte arrays is in another cell called template size that's 352
NF(Number of fingerprint data per user Max. 2) //number of fingerprint per user ( maximum 2 )
TemplateSize //352
FingerData (byte,User Fingerprint data total size depends on the number of fingerprints registered per user) = templatesize * NF
Franco Amato
Bookmarks