You are not logged in.
can somebody help me with this one?
I have to configure rs232 write/read inside a C program.
I'm using the termios.h (POSIX)
The problem is that the only baudrate that works for me is 28800 and
it is not supported any more from this driver.
So I can't write :
At least for the version of termios.h that I have on my SuSe Linux 10.1
I would really appreciate any help.
Oh there is a card connected there which is commanding a robot by a wireless connection. Yes I am sure. I've tried all speeds defined in the termios.h, then I read somewhere in the documentation that the stupid robot is not receiving the command if the speed is other than 28800.
It is working perfectly under Windows. The porblem is that I have to make it also work under linux.
Well, maybe playing around with "setserial" and the "spd_cust", "baud_base", and
"divisor" settings might get you somewhere (in combination with a B38400 from
your app)... I'm not sure, though...
Well I've never thought about this. This is really an interesting idea. I've never used the setserial but I've just googled around and it seems to be a possible solution. At least I have something to try.
Thank you for this tip!
So I'm adding this single line to my Program:
system("/bin/setserial /dev/ttyS1 spd_cust baud_base 115200 divisor 4");
prior to opening the port
and setting the speed like:
It's giving me the hope it will work :smile:
Although I won't be able to test it till Tuesday...
If this works, you might want to grab the source for "setserial" so you can simply
do what it does in your own code, rather than have to use system() to call it, which
is a bit of a kluge... I'm pretty sure it just uses ioctl(TIOC[GS]SERIAL)...
I've tested it a couple of times and it really worked.
RobSeace one more time thank you very much for your suggestion
it really made my day.
I know it is not so exquisite using the "system" but it is not so clear to me how to make it else and I don't think I'll take the path of using this as an internal command, because I'm already fed up with that project and can't wait to finish it :smile: