EasyManuals Logo
Home>Ublox>Control Unit>ODIN-W2 Series

Ublox ODIN-W2 Series User Manual

Ublox ODIN-W2 Series
43 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #40 background imageLoading...
Page #40 background image
ODIN-W2 series - System integration manual
UBX-14040040 - R20 Appendix Page 40 of 43
C1-Public
CRC calculation
/* byte = data buffer in the xmodem block */
/* count = number of data bytes */
/* offset = where to start the calculation */
private ushort xmodemCalcrc(byte[] buffer, int offset, int count)
{
ushort crc, i;
int j;
crc = 0;
for (j = offset; j < count + offset; j++) {
crc = (ushort)(crc ^ (buffer[j] << 8));
for (i = 0; i < 8; i++) {
if ((crc & 0x8000) > 0) {
crc = (ushort)((crc << 1) ^ 0x1021);
} else {
crc = (ushort)(crc << 1);
}
}
}
return (ushort)(crc & 0xFFFF);
}

Table of Contents

Other manuals for Ublox ODIN-W2 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Ublox ODIN-W2 Series and is the answer not in the manual?

Ublox ODIN-W2 Series Specifications

General IconGeneral
BrandUblox
ModelODIN-W2 Series
CategoryControl Unit
LanguageEnglish

Related product manuals