Skip to content

iface-modem-location: fix zeroing capabilities on reinitialization

Since commit 63dd4ad2 it seems that my modem (HP hs2350) loses its location capabilities once it gets unlocked and initialized.

I tracked this to an existing issue in the modem location interface.

This interface loads modem location capabilities only during the very first initialization of this interface.

On each later reinitialization it skips loading these capabilities from modem, however it still goes through the whole interface initialization state machine.

This state machine uses its own ctx->capabilities field for temporary capabilities storage, which is set to MM_MODEM_LOCATION_SOURCE_NONE at the start of the initialization process.

However, if we aren't actually loading modem location capabilities because we're only reinitializing the interface we still need to set this ctx->capabilities field to the existing (previously loaded) modem location capabilities.

Otherwise the next interface initialization step (validation) will permanently disable the whole location interface.

With this change, the location capabilities are preserved around modem initialization.


For this particular modem, however, there's another issue not addressed by this MR: it stops sending NMEA data on the serial GPS port when reinitialized until the NMEA location capability is re-enabled.

This additional issue will probably need to be addressed once this modem supports location capabilities in the upstream ModemManager code - MR !1088 (closed) was about this.

Merge request reports