Commit Graph

7 Commits

Author SHA1 Message Date
Ben Chan
344d96af44 cinterion: check error returned by g_task_propagate_error instead
When returning an enum value via g_task_return_int, some code assumes
the enum value is always non-negative and thus considers that a negative
value implies an error. This assumption could be invalidated if a
negative value is later added to the enum. To make it less error prone
to future changes, this patch modifies the code to check if the GError
argument to g_task_propagate_error is populated instead.
2017-07-07 10:15:07 +02:00
Aleksander Morgado
e2e2c3e019 cinterion: retry GPS Engine activation up to 3 times
The default setup with 100ms between GPS commands doesn't seem to be
always enough for the Engine activation step:

   [1495016625.392972] (ttyACM1): --> 'AT^SGPSC="NMEA/Output","on"<CR>'
   [1495016625.503885] (ttyACM1): <-- '<CR><LF>^SGPSC: "Nmea/Output","on"<CR><LF><CR><LF><CR><LF>OK<CR><LF>'
   [1495016625.607650] (ttyACM1): --> 'AT^SGPSC="Power/Antenna","on"<CR>'
   [1495016625.697862] (ttyACM1): <-- '<CR><LF>^SGPSC: "Power/Antenna","on"<CR><LF><CR><LF>OK<CR><LF>'
   [1495016625.809393] (ttyACM1): --> 'AT^SGPSC="Engine","1"<CR>'
   [1495016625.895970] (ttyACM1): <-- '<CR><LF>+CME ERROR: 767<CR><LF>'

We now setup up to 3 retries for the Engine activation step before
returning an error, and we also update to 2000ms the wait time before
the Engine activation command is run.
2017-05-30 21:06:12 +02:00
Aleksander Morgado
aa8ac416f8 cinterion: support AT^SGPSC capable modems
The AT^SGPSS command provides an easy way to just start/stop GPS, but
unfortunately it isn't supported by all Cinterion modems.

The AT^SGPSC command instead is more widely available but it requires
several steps to start and stop the different elements of the GPS
receiver.

Implement support for both, preferring AT^SGPSSS if available and
falling back to AT^SGPSC otherwise.
2017-05-30 21:06:04 +02:00
Aleksander Morgado
d772301cd4 cinterion: setup GPS port only if GPS support detected
i.e. if AT^SGPSS not supported, we don't even add traces handler to
the GPS data port.
2017-05-30 21:05:56 +02:00
Aleksander Morgado
bf549d1bca cinterion,location: refactor enable/disable and capabilities checks
When checking for location capabilities, we will make sure AT^SGPSS is
supported and if it isn't we won't report GPS capabilities.

The location enable and disable paths are refactored to make it easier
to add possible new GPS commands to use instead of AT^SGPSS, if this
isn't supported (e.g. in the PLS8 devices).
2017-05-30 21:05:44 +02:00
Aleksander Morgado
09eb87f899 cinterion: allow 'unmanaged' GPS setup 2014-07-02 12:28:56 +02:00
Aleksander Morgado
15a3ebbd35 cinterion: enable GPS location reporting for the PHS8 in QMI-mode
The PHS8 in QMI-mode doesn't support GPS location retrieval via QMI, so we will
fallback to use the AT-based setup and the TTY for reading NMEA traces.
2014-07-01 15:46:57 +02:00