0

So i'm trying to develop a program integrating a raspberry pi with a fingerprint reader using a USB adapter.

My problem is that the fingerprint reader requires a custom data package for the handshake process.

I need to send a data array of: Header [2], Adress[4], Indentifier[1], Data Lenght[2],Command[1], control[1], checksum[0].

My code looks something like this

byte[] array = new byte[13];
byte[] start;
start = BitConverter.GetBytes(0xEF01);
var lenght = BitConverter.GetBytes(0007);
var adress = BitConverter.GetBytes(0xFFFFFFFF);
var checksum = BitConverter.GetBytes(0x0D);
array[0] = start[0];
array[1] = start[1];
array[2] = adress[0];
array[3] = adress[1];
array[4] = adress[2];
array[5] = adress[3];
array[6] = 01;
array[7] = lenght[0];
array[8] = lenght[0];
array[9] = 17;
array[10] = 0;
array[11] = checksum[0];
array[12] = checksum[0];

foreach(var bit in array)
{
    DataWriterObject.WriteByte(bit);
}

await DataWriterObject.StoreAsync();


bytesRead = await DataReaderObject.LoadAsync(15).AsTask(ReadCancellationTokenSource.Token);  //Wait until buffer is full

My USB adapter lights up the TX led when the StoreAsync func runs. But my program gets timed out when waiting for the repply.

Ì think that the DataWriter is sending the data not in the right order and the fingerprint sensor is not respoing right.

Is there anyway to know if i`m sending it the right way?

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • I tryed to send data using the WriteBytes method but it didn't work out either. – user3489204 May 09 '18 at 20:47
  • What's your fingerprint reader interface, UART? You mean USB adapter as USB-to-Serial? – Rita Han May 10 '18 at 08:46
  • So, when i was looking up to find the exact same UART to USB adapter, i found a documentation on how to set up the communication, so that might be the problem. In any case, i'm using an Adafruit fringerprint sensor: https://www.adafruit.com/product/751 And a USB to UART bridge from silicon labs, CP210x i don't know right now the exact model. @RitaHan-MSFT – user3489204 May 10 '18 at 21:05
  • So it turns out that document is an old document just giving the basic of what i did in c++. Not very usefull. – user3489204 May 10 '18 at 22:21

0 Answers0