Communication through COM port

Hi

I am developing a program for communicating between two PC’S with QNX 6.2
Can anyone send sample code to open,read,write and close a COM Port
Thank you.

-Shanthi+

shanthi <shanthi@bhelrpt.co.in> wrote:

Hi

I am developing a program for communicating between two PC’S with QNX 6.2
Can anyone send sample code to open,read,write and close a COM Port
Thank you.

#include <fcntl.h>
#include <unistd.h>

int fd;
char buf[100];
int main()
{
fd = open( “/dev/ser1”, O_RDWR);
read(fd, buf, 100);
write(fd, “hello”, 5 );
close(fd);
}

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.