By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,731 Members | 1,104 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,731 IT Pros & Developers. It's quick & easy.

Parser Question from interviews

P: 1
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)

Q:
1. In one of the measures the speed sensor had a large error. Where?
2. Find the wrong FCS
Attached Files
File Type: txt parser.txt (23.3 KB, 268 views)
Sep 16 '17 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.