
CRC calculation function:
uint32_t CrcCalc::calcCrc32_32(const uint8_t *data, const uint32_t size)
{
uint32_t crc = initValue;
for(uint32_t i = 0; i < size; i++)
{
crc = calcCrc32Uint32(crc, data[i]);
}
return crc ^ xorValue;
}
uint32_t CrcCalc::calcCrc32Uint32(uint32_t crc, uint32_t data)
{
int32_t i;
crc = crc ^ data;
for(i=0; i<32; i++)
{
if (crc & 0x80000000)
{
crc = (crc << 1) ^ polynom;
}
else
{
crc = (crc << 1);
}
}
return(crc);
}
7.6. Acknowledge ACK (response)
DATA_ACK
An acknowledge (ACK) by the camera confirms the successful processing of commands, which do not respond with a set of data e.g. such
as distance (GET_DIS).
Response type
0x00:
Acknowledged (ACK)
Response data
0 bytes
Response
| 0xFA |
0x00
|
0x00 0x00
| (
0 bytes
) | 0xBC 0x7D 0x6A 0x77 |
7.7. Error handling
In case of a communication error, two special responses are implemented.
DATA_NACK
System response only: Command not accepted or unknown.
Response type
0x01:
Not acknowledged
Response data
0 bytes
Response
| 0xFA |
0x01
|
0x00 0x00
| (
0 bytes
) | 0xDA 0xD7 0x6A 0x85 |
DATA_ERROR
System response only: Error occurred during the execution of the command. Response instead of the required data.
Response type
0xFF:
Error
Response data
2 bytes: bit 0..14: Error number. Try it again. If the error remains, contact your sales responsible.
bit 15:
0
Response e.g.
| 0xFA |
0xFF
|
0x02 0x00
|
0x03 0x00
| 0xC7 0x30 0x55 0x4B | (error number 3)
© 2019 ESPROS Photonics Corporation
Characteristics subject to change without notice
11 / 39
Installation_and_Operation_Manual_TOF>cam_635-V0.21