gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-users] Disabling hotplugging and manually connecting to device


From: Ed W
Subject: Re: [gpsd-users] Disabling hotplugging and manually connecting to device
Date: Mon, 19 Dec 2011 16:06:43 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 17/12/2011 07:29, Pris Matic wrote:
Hi all,

I have an application which uses multiple devices that contain a USB to Serial chipset. I'd like to prevent gpsd from automatically detecting and starting communication with any such devices I plug in. I'd much rather have my application test these devices one by one. Is there any way I can prevent gpsd from acting on hotplug events in the first place, and then ask gpsd to test given device addresses one by one (ie, /dev/ttyUSB0, /dev/ttyUSB1, and so on) through my application?


Hi, the hotplug stuff is completely optional part of the build. Recent gpsd simply has a script which calls gpsdctl for all things which look something like a serial to usb adaptor.

I wrote a small (well 1,000 line...) wrapper in perl that probes each serial port to determine if it's a modem, gps or something else and then calls the appropriate "add" event for each. Most of that code is serial port library code for reliable communications, the logic is roughly to loop waiting for something to be respond and in the meantime listen for stuff and occasionally send an AT to the device.

It's not particularly secret so happy to share, but equally it's not that pretty so I'm not posting it here...

The big picture here is actually quite simple, devil is in the details of course...

Good luck

Ed W



reply via email to

[Prev in Thread] Current Thread [Next in Thread]