rs232

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
neuling
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Jun 07, 2012 1:09 am

rs232

Postby neuling » Wed Jun 13, 2012 10:04 am

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

Elmi
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Thu Mar 12, 2009 3:23 pm
Location: Germany
Contact:

Re: rs232

Postby Elmi » Wed Sep 19, 2012 7:14 am

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.

Jive Dadson
Experienced Solver
Experienced Solver
Posts: 60
Joined: Thu Sep 06, 2012 8:00 pm

Re: rs232

Postby Jive Dadson » Wed Sep 19, 2012 10:48 pm

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.

PK
In need of some credit
In need of some credit
Posts: 7
Joined: Mon Jan 14, 2013 6:30 am

Re: rs232

Postby PK » Thu Dec 12, 2013 3:38 am

There are several setups here

Code: Select all

https://github.com/vliedel/FireSoft/tree/master/serial (cross platform)

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

Code: Select all

EnumSerialPorts v1.24 at http://www.naughter.com/enumser.html (Windows)
 n = scandir(sysdir, &namelist, NULL, NULL);..... (Linux)


Patrick


Return to “Component Writing”

Who is online

Users browsing this forum: No registered users and 1 guest