# define PRESET_VALUE 0 XFFFF
# define POLYNOMIAL 0 x8408
Unsigned int uiCrc16Cal (unsigned char const * pucY, unsigned char ucX)
{
Unsigned char ucI, ucJ;
Unsigned short int uiCrcValue=https://bbs.csdn.net/topics/PRESET_VALUE;
For (ucI=0; UcI & lt; UcX. UcI++)
{
UiCrcValue=https://bbs.csdn.net/topics/uiCrcValue ^ * (pucY + ucI);
For (ucJ=0; UcJ & lt; 8; UcJ++)
{
If (uiCrcValue & amp; 0 x0001)
{
UiCrcValue=https://bbs.csdn.net/topics/(uiCrcValue> 1) ^ POLYNOMIAL;
}
The else
{
UiCrcValue=https://bbs.csdn.net/topics/(uiCrcValue> 1);
}
}
}
Return uiCrcValue;
}
CodePudding user response:
You try to put this function directly into the JAVA project compile once, see if you can compile, JAVA and C language on the base types or the same,CodePudding user response:
No, in the idea of error directly