Home » U++ Library support » U++ Library : Other (not classified elsewhere) » About RS232
Re: About RS232 [message #28176 is a reply to message #3788] |
Fri, 20 August 2010 13:58 |
jeremy_c
Messages: 175 Registered: August 2007 Location: Ohio, USA
|
Experienced Member |
|
|
Last night I grabbed a copy of libctb (https://iftools.com/opensource/ctb.en.php). I modified the source a bit and made a U++ package out of it. So now I just say Add Package, Ctb and my app has serial support.
I have not tested it yet under linux but will be doing so shortly. The only problem with what I did was I had to change several headers for the package. For example, the ctb package uses:
#include "ctb-0.15/abcdef.h"
I changed these to read:
So, with each update to libctb, that would have to be done. Is there a better way? I wanted to let U++ handle the building of the package.
I started with Serial.h/.cpp that I found here and it worked fine for some devices I was controlling but not for others. I needed the ability to set 2 stop bits, to raise the DTR and RTS states, etc...
I am not sure what is the best idea here. To keep my Ctb package or to browse it's source, learn how the Data Bits, Parity, Stop Bits and Line States are set/queried and port them to the Serial.h/Serial.cpp. I kind of liked the Serial.h/.cpp's function ReadDataWaiting(). w/Ctb you can read X number of bytes with a timeout but say you want 30 bytes, Readv(buf, 30); may result in a partial read, i.e. maybe 15 were available before the timeout occurs. You'll get the 15. With Serial.h/.cpp I could enter a loop and say:
tries = 0;
while (ReadDataWaiting() < 30) {
tries++;
if (tries > 3) do_fail_code();
Sleep(50);
}
Jeremy
|
|
|
|
|
About RS232
|
|
|
Re: About RS232
By: mirek on Mon, 26 June 2006 20:05
|
|
|
Re: About RS232
By: qwerty on Tue, 11 July 2006 19:44
|
|
|
Re: About RS232
By: qwerty on Mon, 11 September 2006 01:25
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: ebojd on Wed, 25 April 2007 20:39
|
|
|
Re: About RS232
|
|
|
Re: About RS232
|
|
|
Re: About RS232
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: forlano on Fri, 10 October 2008 21:33
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: forlano on Sat, 11 October 2008 11:17
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: forlano on Sat, 11 October 2008 23:07
|
|
|
Re: About RS232
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: forlano on Sun, 12 October 2008 23:03
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: forlano on Mon, 13 October 2008 23:00
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: forlano on Mon, 20 October 2008 19:27
|
|
|
Re: About RS232
By: gxl117 on Wed, 11 November 2009 08:44
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: gxl117 on Fri, 13 November 2009 04:40
|
|
|
Re: About RS232
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: Didier on Tue, 26 January 2010 22:54
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: Didier on Fri, 05 February 2010 00:19
|
|
|
Re: About RS232
|
|
|
Re: About RS232
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: Reini on Sat, 06 March 2010 18:42
|
|
|
Re: About RS232
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: Didier on Sun, 07 March 2010 13:38
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: Didier on Sun, 07 March 2010 19:50
|
|
|
Re: About RS232
By: Didier on Sun, 07 March 2010 20:56
|
|
|
Re: About RS232
By: mr_ped on Wed, 16 June 2010 16:55
|
|
|
Re: About RS232
By: Didier on Wed, 16 June 2010 22:08
|
|
|
Re: About RS232
By: mr_ped on Wed, 16 June 2010 16:57
|
|
|
Re: About RS232
By: jeremy_c on Fri, 20 August 2010 01:30
|
|
|
Re: About RS232
By: koldo on Fri, 20 August 2010 08:23
|
|
|
Re: About RS232
By: jerson on Fri, 20 August 2010 10:00
|
|
|
Re: About RS232
By: jeremy_c on Fri, 20 August 2010 13:58
|
|
|
Re: About RS232
By: koldo on Fri, 20 August 2010 14:30
|
|
|
Re: About RS232
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: jerson on Sun, 21 November 2010 16:21
|
|
|
Re: About RS232
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: jibe on Fri, 15 March 2013 14:40
|
|
|
Re: About RS232
By: Zbych on Fri, 15 March 2013 16:04
|
|
|
Re: About RS232
By: jibe on Fri, 15 March 2013 15:55
|
|
|
Re: About RS232
By: jerson on Fri, 15 March 2013 16:00
|
|
|
Re: About RS232
By: jibe on Fri, 15 March 2013 22:45
|
|
|
Re: About RS232
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: deep on Thu, 09 May 2013 08:58
|
|
|
Re: About RS232
|
|
|
Re: About RS232
By: jibe on Wed, 20 March 2013 15:22
|
Goto Forum:
Current Time: Thu Apr 25 03:57:07 CEST 2024
Total time taken to generate the page: 0.02839 seconds
|