You are not logged in.

#1 2005-06-26 13:32:01

Blaster
Member
Registered: 2004-09-17
Posts: 49

c++ rs232

I'mtrying to write to the serial port in c++ but is doesn't seem to work. In windows in use a program called docklit or something like that . And the rs232, gadget is working fine.
The gadget relpy at OK when i transmit a I sleep 2 ms and then an R

Settings for the serial port should be 9600Baud, 8 databit 1 stop bit rest doesn't matter

Trying to do the same in linux with a c program i get nothing. can someon plz help me write at simple c++ program the target the rs232 port with the above settings and when written R to the port listens for reply on the same port.

Offline

#2 2005-06-27 14:38:28

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: c++ rs232

just open the proper /dev/ttyS0X node like a normal file and write/read...

std::fstream f("/dev/ttyS01",std::ios::out);
f << "hello world" << std::endl;

...should work

Offline

Board footer

Powered by FluxBB