![]() ![]() Leading me to the conclusion that the most significant bit is being set to 0 by the settings and functions that I'm using. They did reveal,at the correct byte spacing, a sequence of 0x7A 0x7F 0x32 0x30, and no values above 127 or below 0. However the cout statements showed no such input. The beginning of each message is a fixed sequence of 0xFA 0xFF 0x32 and 0x30, and I use this to make sure I am reading the correct part of the data sequence. Upon running the code I didn't get any output, so I inserted a series of cout statements to let me know what data was being received, and it became evident that corruption was occurring. Finally it spawns a pthread to handle the data reception, which is done using read(). It then goes on to set the speed, data size, parity etc appropriately. The code uses the open() function to open /dev/ttyS0 for read and write, with ndelay and and noctty set. I have run into a problem receiving data over the serial port. At current I am developing and testing the application on my desktop using Debian, but it will eventually need to run on embedded Linux, so I am keen to stay away from non standard libraries if I can. The information that the unit sends is full floating point, encoded not as ASCII text but split up into the constituent bytes and sent serially. ![]() I'm currently working on an application to get information from a commercial module that makes use of RS232 communications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |