User's Manual
i-PORT MB – Manual
Version 1.1 02.02.2007 Page 37/
37
0x88, 0x48, 0x49, 0x89, 0x4b, 0x8b, 0x8a, 0x4a, //29
0x4e, 0x8e, 0x8f, 0x4f, 0x8d, 0x4d, 0x4c, 0x8c, //30
0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, //31
0x82, 0x42, 0x43, 0x83, 0x41, 0x81, 0x80, 0x40, //32
};
//! CRC calculation for Host communication
unsigned int build_crc16(unsigned char *host_msg, unsigned int len)
{
unsigned char crc_hi = 0xFF; // high CRC byte initialized
unsigned char crc_lo = 0xFF; // low CRC byte initialized
unsigned char index; // will index into CRC lookup table
while (len--) // pass through message buffer
{ // and calculate the CRC
index = crc_hi ^ *host_msg++;
crc_hi = crc_lo ^ crc_tab_hi[index];
crc_lo = crc_tab_lo[index];
}
return crc_lo<<8 | crc_hi;
}
Example commands with CRC
This example shows two commands sent to a reader.
Sending “disconnect slave port” to the broadcast address:
\x01\xFF\x43\x10\x90\x00\x00\x00\x00\x3f\xDB\x04
Note, there is no response to this command as it is sent to the broadcast address. The character 0x10 has
been translated into the sequence 0x10 0x90.
Sending “get parameter serial number” to the last reader in chain:
\x01\xFE\x44\x10\x81\xF0\xE2\x04
The character 0x01 has been translated into the sequence 0x10 0x81. The device responds with its serial
number:
\x01\x11\xC4\x00\x18\x7F\x5D\xCA\x3A\x85\x04
www.identecsolutions.com
Europe:
Austria:
IDENTEC SOLUTIONS AG, Millennium Park 2, 6890 Lustenau / AUSTRIA Tel: +43 (0)5577 87387-0 Fax: +43 (0)5577 87387-15
North America:
USA:
IDENTEC SOLUTIONS INC.,
Liberty Plaza II, 5057 Keller Springs Road Suite 375, Addison, Texas 75001 / USA Tel: +1(972) 535 4144 Fax: +1(469) 424 0404