This is my first request in this forum, as I have been around for a long time with a problem:
Through TCP binding I get a corresponding string; This is evaluated in a rule and an “ACK” message is generated. This is now to be returned to the device. The problem is that the string must contain a checksum (CRC16) for the recipient to accept the message. The checksum is generated from the message length.
Can someone tell me how to create a CRC16 checksum in openHAB2 from a string?
Thank you for the informations.
Unfortunately, I’m not the Java Specialist. How is the module to be integrated so that I can use the function in a rule? Can you help me here?
Do you have any progress with calculation of CRC? Because I also need it. The main problem for writing it on Xtend is missing XOR operator in this language. Do you find any tricks?
Even though it’s not documented, the ^ operator might work.
If not you could write a lambda and implement the XOR using the operators you do have. See https://stackoverflow.com/questions/373262/how-do-you-implement-xor-using for lots of approaches.