Hi everybody,
i'm looking for a library and some examples on how to write an API under wxWidgets which can write and receive informations via rs232.
i've downloaded the latest version of wxCtb, but don't really know what to use and how i should use it.
could anybody help me?
Thanks,
neuling
rs232
Re: rs232
For RS232 access youd don't necessarily need a wxWidgets solution (especially in case nobody knows how to use it or they are not udpated for newer wxWidgets versions), there are several platform-independent solutions out there.
I'm using this one here: https://fedorahosted.org/OpenAPC/browser/liboapc
The relevant functions are all named oapc_serial_ and should be self-explanatory.
I'm using this one here: https://fedorahosted.org/OpenAPC/browser/liboapc
The relevant functions are all named oapc_serial_ and should be self-explanatory.
-
- Experienced Solver
- Posts: 60
- Joined: Thu Sep 06, 2012 8:00 pm
Re: rs232
What he said. You do not want to mix the rs232 code into the wxWidget code. The rule of thumb is to keep the interface and the implementation separate. I let a boss of me talk me into breaking that rule once, for expediency, and we both lived to rue the day. Where was I? Oh yes. RS232. It is a bear. Obtaining a platform independent API is only a first skirmish of what often proves to be a tough battle. It is the most non-standard there is. Are Rx and Tx connected? Is it null-cable? How about stop-bits? Are those connectors good? Parity? Yada, yada, @#$%ing yada. Good luck.
Re: rs232
There are several setups here
that I have running in wxWidgets using Boost (they get along fine). All are cross-platform and some are threaded and buffered - the whole works. Very fast and reliable so far. I had to look a little further for enumerating the ports (I should not post the whole function here as it is not wxWidgets specific) see
Patrick
Code: Select all
https://github.com/vliedel/FireSoft/tree/master/serial (cross platform)
Code: Select all
EnumSerialPorts v1.24 at http://www.naughter.com/enumser.html (Windows)
n = scandir(sysdir, &namelist, NULL, NULL);..... (Linux)