Bahar Jalali

Bahar Jalali

  • NA
  • 185
  • 304.9k

how can i write a class for this codes?

Mar 10 2010 2:26 AM
hi
i want connect to a fingerprint sensor "suprema";
i want use one mode that called Enroll by Scan;

for that , i have some command like this:
that used when i want use automatic id mode for fingerprint;
 Start Code: 40 h
Command : 05 h
Parameter : ( Finger ID) 00 h , 00 h , 00 h , 00 h
Size : 00 h , 00 h , 00 h , 00 h
Flag : 79 h
Check Sum : 40h + 05 h + 00 h + 00 h + 00 h + 00 h + 00 h + 00 h + 00 h + 00 h + 79 h = BE h
End Code : 0A h

i must give this information to the sensor;

and sensor return me this information:
 Start Code: 40 h
Command : 05 h
Parameter : ( Finger ID That Save ) xx h , xx h , xx h , xx h
Size : 00 h , 00 h , 00 h , 00 h
Error : 61 h or 62 h or 63 h or 6B h or 6C h or 6D h or 6E h or 72 h or 76 h
that error code has a table to know any code;
Check Sum : 40h + 05 h + xx h + xx h + xx h + xx h + 00 h + 00 h + 00 h + 00 h + xx h = xx h
End Code : 0A h


and i must write a class that i can use this information on it... i must give information to sensor and i must connect to sensor and sensor give me some information and i must describe that every information has what mean;

now i write this code only :
 byte[] b = new byte[15];
b[0] = 0x40; //start byte
b[1] = 0x05; //command
b[2] = 0x00; //paramid
b[3] = 0x00;
b[4] = 0x00;
b[5] = 0x00;
b[6] = 0x00; //size
b[7] = 0x00;
b[8] = 0x00;
b[9] = 0x00;
b[10] = 0x79; //flag
b[11] = 0xBE; //checksum
b[12] = 0x0A; //end code
 
i don't know what can i do... please help me
thanks

Answers (1)