Add CRC calculation for IL2P
The byte order might be wrong. We must test it with the reference implementation. Unfortunately, I don't have any.
#507 It solves this feature request.
The indentation seems to be mismatched.
EDIT: I just saw https://github.com/wb2osz/direwolf/issues/573; might be worth just keeping the indentation of the line immediately preceding it?
@Pandapip1 That is a PITA if you work with a modern code editor just like I do with VS-code.
Weird. I use vscodium and if anything it doesn't mess with the indentation when it should. Definitely there should be a consistent indentation style throughout though; that is pretty obviously beneficial.
Ok. It turned out in the meantime, that I misinterpreted the standard. I tried to fix it, but now I have some problem that I don't know how to solve. The standard says that the input of the CRC is the AX.25 data before it is scrambled and encoded. After getting the IL2P frame from the radio, it is translated back to AX.25 data. However, some of the fields are not presented in the IL2P header, such as the MSB of the SSID. I experience that this field is set differently, when we regenerate the packet, and the CRC fails. This is only an issue with TYPE-1 packets, when the AX.25 header is compressed.
I leave this PR as it is, and hope someone can help me sort these things out.