|
From: | Stoner, Howard (US COM) |
Subject: | [gpsd-users] how to send control string (command) to device with <CR><NL> included in string |
Date: | Thu, 8 Sep 2016 14:56:39 +0000 |
I'm new to this list, and didn't find anywhere else to ask this question and get a response, so I'm asking here. I am trying to figure out how a local application (running linux on an embedded SoC) can send a command to my GPSD device (e.g. a proprietary device text command
to switch in/out of 'STANDBY' mode, of the form "$PMTK..."), while gpsd is running. From reading the gpsd daemon documentation, it sounds like sending a message via the Control Socket connection, of the form "!/dev/ttyxx=$PMTK..." should do
this. I tried implementing this, and created the string containing my device command, including a "<CR><NL>" at the end of the message, which the device requires. But it looks like the gpsd control handler is stripping the <CR><NL> from the end of the message, and not sending it to the device... I think this is making
the device ignore the message. From looking at the gpsd source, it looks like the handle_control() function is calling 'snarfline()', which is stripping off any whitespace including the <CR><NL> from the message. How can I send the control string WITH the <CR><NL> included via the control socket?
I also tried doing this with the 'gpsctl' client, which only works if I have gpsd NOT connected to the device at the time. Thank you, -Howard |
[Prev in Thread] | Current Thread | [Next in Thread] |