[asio] DTR serial port option?

Hello, I'm rewriting a C# program in C++. This C# program previously was communicating with a device via serial port. One thing in particular it was doing was setting the DTR flag to enabled. The MSDN article on this option is here: http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.dtrenable... http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.dtrenable...I do not see an option in the Boost.Asio documentation that is identical to this C# option. Can anyone comment on this? How can I enable DTR through Boost Asio's serial_port? --------- Robert Dailey

Actually, after looking deep into the serial_port implementation, I see that
DTR_CONTROL_ENABLE is set on the port in:
serial_port_base::flow_control::store()
Is it disabled at any point?
---------
Robert Dailey
On Fri, Aug 28, 2009 at 9:55 AM, Robert Dailey
Hello, I'm rewriting a C# program in C++. This C# program previously was communicating with a device via serial port. One thing in particular it was doing was setting the DTR flag to enabled. The MSDN article on this option is here:
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.dtrenable...
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.dtrenable...I do not see an option in the Boost.Asio documentation that is identical to this C# option. Can anyone comment on this? How can I enable DTR through Boost Asio's serial_port?
--------- Robert Dailey

Wow, okay. So here's what I've figured out:
You have to specify the serial_port_base::flow_control option in order for
the DTR and RTS to be set. If you don't, the code never gets executed. This
whole time I thought that if I did not specify the flow_control option that
these things would be set to their defaults. However, this does not seem to
be the case. Rather dangerous!
Am I mistaken, or does this need to be addressed?
---------
Robert Dailey
On Fri, Aug 28, 2009 at 10:14 AM, Robert Dailey
Actually, after looking deep into the serial_port implementation, I see that DTR_CONTROL_ENABLE is set on the port in: serial_port_base::flow_control::store()
Is it disabled at any point?
--------- Robert Dailey
On Fri, Aug 28, 2009 at 9:55 AM, Robert Dailey
wrote: Hello, I'm rewriting a C# program in C++. This C# program previously was communicating with a device via serial port. One thing in particular it was doing was setting the DTR flag to enabled. The MSDN article on this option is here:
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.dtrenable...
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.dtrenable...I do not see an option in the Boost.Asio documentation that is identical to this C# option. Can anyone comment on this? How can I enable DTR through Boost Asio's serial_port?
--------- Robert Dailey

Robert Dailey wrote:
Wow, okay. So here's what I've figured out: You have to specify the serial_port_base::flow_control option in order for the DTR and RTS to be set. If you don't, the code never gets executed. This whole time I thought that if I did not specify the flow_control option that these things would be set to their defaults. However, this does not seem to be the case. Rather dangerous!
Am I mistaken, or does this need to be addressed?
For answers to these specifics, you could also try posting to the separate asio mailing list. Cheers, Rutger

Hi Rutger,
On Fri, Aug 28, 2009 at 11:16 PM, Rutger ter Borg
For answers to these specifics, you could also try posting to the separate asio mailing list.
I visited http://sourceforge.net/mailarchive/forum.php?forum_name=asio-users but I can't find any subscribe link that I can use to subscribe. Would you please post a link so that I can subscribe to ASIO specific list? What's the difference between between posting on ASIO list and this boost list? Isn't ASIO included in Boost now? Best regards, -Asif

On Fri, Aug 28, 2009 at 3:05 PM, Asif Lodhi
Hi Rutger,
On Fri, Aug 28, 2009 at 11:16 PM, Rutger ter Borg
wrote: For answers to these specifics, you could also try posting to the separate asio mailing list.
I visited http://sourceforge.net/mailarchive/forum.php?forum_name=asio-users but I can't find any subscribe link that I can use to subscribe. Would you please post a link so that I can subscribe to ASIO specific list?
What's the difference between between posting on ASIO list and this boost list? Isn't ASIO included in Boost now?
I'd like to know this too. I see no reason why I can't ask here. In any case, here's the problem I'm running into. I need to be able to enable DTR, send data, and then disable DTR afterwards. The only way I can get DTR to be enabled is by explicitly setting the flow_control() option, however if I do this then I cannot disable it later. I see that MSDN discusses this function: EscapeCommFunction(); If I could do something like: EscapeCommFunction( impl.handle_, SETDTR ); ::WriteFile( imple.handle_, ...... ); EscapeCommFunction( impl.handle_, CLRDTR ); This might give me what I need, right? How can I do this through boost asio?

I can't find any subscribe link that I can use to subscribe. Would you please post a link so that I can subscribe to ASIO specific list?
https://lists.sourceforge.net/lists/listinfo/asio-users
I'd like to know this too. I see no reason why I can't ask here.
Sure you can ask, but the people who know asio in detail are on the asio list. Chris -- echo mailto: NOSPAM !#$.'<*>'|sed 's. ..'|tr "<*> !#:2" org@fr33z3

Hi christoph,
On Sat, Aug 29, 2009 at 5:42 AM, Christoph Gysin wrote: I can't find any subscribe link that I can use to subscribe. Would you please post a link so that I can subscribe to ASIO specific list? Thank you.
-Asif

Hi Christoph,
On Sat, Aug 29, 2009 at 5:42 AM, Christoph Gysin wrote: I have subscribed but I can't find any search box or something on the
archives page. Can you tell me how I can search archives?
Thanks in advance,
-Asif

I have subscribed but I can't find any search box or something on the archives page. Can you tell me how I can search archives?
Sure, use gmane: http://news.gmane.org/gmane.comp.lib.boost.asio.user Chris -- echo mailto: NOSPAM !#$.'<*>'|sed 's. ..'|tr "<*> !#:2" org@fr33z3

Thanks Chris,
On 8/30/09, Christoph Gysin
I have subscribed but I can't find any search box or something on the archives page. Can you tell me how I can search archives?
Sure, use gmane: http://news.gmane.org/gmane.comp.lib.boost.asio.user
The so obvious never occurred to me! :) Thank you, -Asif
participants (4)
-
Asif Lodhi
-
Christoph Gysin
-
Robert Dailey
-
Rutger ter Borg