summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Bonn <jonas@norrbonn.se>2019-09-25 06:35:07 +0200
committerDenis Kenzior <denkenz@gmail.com>2019-09-25 21:25:16 -0500
commit93f03865f731fb4b9d368b8e99bd458aa0efca53 (patch)
tree2619af91c6655a8b73fbc6cc76184ec88a2b8300 /src
parent0b3c64097152eb72935fabdef6c22939043729fe (diff)
downloadofono-93f03865f731fb4b9d368b8e99bd458aa0efca53.tar.gz
ublox: rework device initialization sequence
uBlox devices present their USB interfaces well before those interfaces are ready to respond to any commands. The documentation says to monitor the 'greeting text' to detect readiness, but this 'greeting text' is not actually specified for any device other than the TOBY L4. What seems to work is to probe the device with 'AT' commands until the device responds, and then to wait an additional second before proceeding. The TOBY L4 reliably sends its 'greeting text' (+AT: READY) within this interval. It would be more rigorous to actually wait for the 'READY' indication for the TOBY L4, but that would require knowing the device model before the device model is actually queried. This is doable via the USB product ID, but overkill when the above heuristic seems to work reliably. Before this patch, the ublox plugin was trying to achieve something like the above with the g_at_chat_set_wakeup_command() function, but that had some issues: i) it did not work reliably, in particular failing badly on the TOBY L4 with responses getting out of sync with commands ii) it was an inappropriate use of the wakeup_command which is intended for devices that may sleep when there is no communication during some interval This patch adds an init sequence that probes the device for readiness before continuing with initialization.
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions