Search code examples
unetstack

How to check whether CRC is working correctly in the custom phy agent in unetaudio?


I have implemented CRC8 instead of parity byte which is used in the given implementation of custom phy agent as mentioned in this unetstack blog. CRC is working fine when the received data is same as transmitted data by checking ntf.data command. I want to check when the data is modified whether the CRC is working properly or not. Is there any method to modify data or some other procedure to know that when data is modified while transmission by which i can verify that CRC is working for that case also.


Solution

  • To test whether your CRC8 implementation is working, the easiest thing to do is to update your PHY implementation to randomly flip a few bits and see if that is detected by your CRC8 check. Once tested, you can remove the bit flipping.

    Alternatively you can use unet audio to transmit and receive and reduce SNR to the point errors are introduced. However, this is a non-deterministic process, and so personally I prefer the method of artificially introducing errors programmatically.