Communication through COM port

bridged with qdn.public.qnxrtp.x86
Post Reply
shanthi

Communication through COM port

Post by shanthi » Wed Nov 20, 2002 9:28 am

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+

David Gibbs

Re: Communication through COM port

Post by David Gibbs » Wed Nov 20, 2002 7:55 pm

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.

Post Reply

Return to “qdn.public.qnxrtp.x86”