crc16 checksum in matlab

30 次查看(过去 30 天)
Mohamed Jamal
Mohamed Jamal 2020-8-8
Hi guys
Im trying to implement a function that check the checksum of my input, and return if it's false or true (valid or not valid).
crc is crc16 that I input to my function an array that every value is an unsigned decimal value (Byte value, unsigned integer) like arr1=[1, 2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 10] , and my crc is the last two bytes , so I want to verify if my crc is valid by check the checksum of my arr1(implcitly its data of my packet), the other bytes (values) in my array arr1 is the payload data so here in my example the paylaod is [1 ,2 ,3 ,4 ,5 ,6 , 7,8] and the crc is the two last bytes(values) [9,10] .
how can I in matlab calculate the checksum of my given packet (in other words arr1) if the data is valid or not valid by checking the checksum? the checksum if zero this means ok, otherwise it's not valid.

回答(1 个)

Steven Lord
Steven Lord 2020-8-8

类别

Help CenterFile Exchange 中查找有关 Error Detection and Correction 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by