Hi,
I’m new to QNX and I’ve been trying to use these following functions:
modem_open()
modem_write()
modem_read(),
to open, write, and read to serial ports.
I’ve been testing out how to use these functions but there’s just one problem (probably very simple).
I have physically linked together the receive and transmit lines of the serial port I’ve been working with. I have opened the serial port, written a simple string to it, and tried to read the data just written, all on the same port. All the functions executed without errors. However, I just can’t seem to read correctly the data that I wrote to the port. I don’t get any errors when running the program so I don’t know if the data is being written incorrectly to the port or read incorrectly from the port.
The data I read is just rubbish. I’m baffled as to what is wrong. Am I not allowed to write to a port and then read from it again straight afterwards?
Any help would be greatly appreciated.
Thanks
John Lai
PS: I don’t know if this matters, but I’ve configured the port to be in “raw mode”.