The file parser.log consists of a sensor with the following structure:
0x7E 0x40 0x51 Data (17 bytes) FCS(CRC) 0x7E
Inside the Data stream the speed is from the 9th bit to the 20th (including). The data is in little endian.
Whenever 7E should have appeared in the data or FCS calculation it was replaced by “7D 5E” and 7D was replaced by “7D 5D”.
FCS is calculated as follows 0XFF -Sum(header and data bytes)%0X100
header and data bytes =all the message w/o starting and ending 0X7E and FCS.
The speed has a factor of 0.1 between the data and real value( meaning a value of 456 is actually 45.6)
Question: Find the wrong FCS.
Can somebody guide me how to do this... I am trying to do it in excel but the calculation is to long for it.
CodePudding user response:
Excel is not a match for this kind of questions. I would advise you to use a known parser for this kind of data, or write one yourself. You can start by defining a struct
in C (or C ), explaining the format of your data, and go on from there.