Boost logo

Boost Users :

Subject: Re: [Boost-users] Asio Serial ports: enumerating all the devices
From: Vincent Boucher (vin.boucher_at_[hidden])
Date: 2013-04-11 11:55:01


On 11 Apr 2013, at 17:44, Kerry, Richard wrote:

>
>> I guess that it might be harmful for some other devices that
>> could mis-interpret my "poll" message or not handle it correctly.
>
> Each type of device will have its own protocol/command set.
> If you try sending the same command to a variety of ports with unknown devices on them you could indeed cause problems.
> Consider if, in response to a command, say "abc123" :
> One device returns "I'm here"
> Another device formats all its disks and performs a Factory Reset .....
>
>
> With serial control you need to know what you are talking to.
> Or at least you need to know the possible set of devices (ie protocols) you are talking to.
> Ideally you know in advance, via some sort of configuration.
> If you are in the position you appear to be, where you don't know, then you do at least need to know the set of possible devices/protocols, as you need to select suitable commands for polling.
>
> "preparing my device to answer to a custom poll message "
> Do you mean you are also in control of the embedded software within the device ?

> Ie that you are making hardware so can get this sorted out for your own purposes ?
> Or is this not so and you are dealing with existing serial devices ?

I could ask the hardware guys to implement such a response, but then it would be added to the firm/hardware in a further release, not now.

My question is also about: if the OS can list the connected serial devices (when plugging and unplugging the device, the content of /dev is automatically updated) why Boost could not? Could Boost benefit of the updated /dev content? Of course such a list would not detail hardware info (such as baudrate) but at least would propagate device presence to user code. Also, could it be done in a cross platform manner?

>
>
> Unhelpfully,
> Regards,
> Richard.
>
> BNCS Engineer.
> Ie my job is largely concerned with interfacing between PCs and a wide variety of manufacturers' devices. The devices may be on serial connections, or TCP, or UDP (eg SNMP) or other network connection, or sometimes GPIs. I think we have a few on USB. And some actually have their interface handled via a manufacturer-supplied library and API, so we don't see the hardware connection directly.
> For each protocol, or device type, we have a separate driver program. So it is necessary to know in advance what devices are to be controlled as we need to know what to run, and what address/port the device is connected to.
>
>
>
>
>
>> -----Original Message-----
>> From: Boost-users
>> [mailto:boost-users-bounces_at_[hidden]] On Behalf Of
>> Vincent Boucher
>> Sent: 11 April 2013 16:28
>> To: boost-users_at_[hidden]
>> Subject: Re: [Boost-users] Asio Serial ports: enumerating all
>> the devices
>>
>> Thanks, I understand there's no other hope than preparing my
>> device to answer to a custom poll message and checking the
>> returned message (if any) to see if my device is connected.
>>
>> I guess that it might be harmful for some other devices that
>> could mis-interpret my "poll" message or not handle it correctly.
>>
>> Vincent
>>
>> On 11 Apr 2013, at 17:00, Kerry, Richard wrote:
>>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net