I am a beginner in using qnx system, so sorry my simlpy questions!
I show my task with a very simply example:
I want to read some characters or numbers from serial port (from another hardware), and after some transformation (adding, multiplying ect.) I want to write it back to the serial port.
How can i make this work?
Is there any software which i can program the serial port with?
Are there any books about this topic?
Maybe there’s a simpler solution, but the one I know is to create a c code and compile it. You can use ‘open’, ‘close’, ‘read’, ‘write’ for managing the serial port, and some other commands and structures (take a look at termios, tcgetattr, tcsetattr, setispeed, setospeed…) to configure it.
There’s a chapter about this topic in Posix Programmers Guide. I think it was around page 153.
I wrote the following snippet of code to test reading from the serial port:
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <fcntl.h>
using namespace std;
int main()
{
int fd;
int numRead;
char buffer[255];
fd = open("/dev/ser1", O_RDONLY);
while(1)
{
memset(buffer, 0, sizeof(buffer));
numRead = read(fd, buffer, sizeof(buffer));
cout << "Read in " << numRead << " characters from serial port." << endl;
cout << "Buffer is <" << buffer << ">" << endl;
}
return 0;
}
I attached a serial mouse to my serial port, ran the program and moved the mouse and I see nothing displayed to the screen.
Looking in /dev I see /dev/ser1 and the 8250 driver is started and running obviously (from pidin).
So from the command prompt I typed:
cat < dev/ser1
moved the mouse and again nothing.
Now on older PC hardware (very old hardware) doing that cat command with the same serial mouse displays characters when I move the mouse.
So since I don’t see anything on my current system does that mean I have some kind of hardware incompatible serial chip on my MB?
The box is a Dell GS 280 and from Windows the device manager reports it as an Intel 82801 chip set. I don’t see any driver that resembles this anyplace.
Is there any way to tell what kind of chipset is supported on this machine?