eclipse-kura / kura

Eclipse Kura™ is a versatile framework to supercharge your edge devices, streamlining the process of configuring your gateway, connecting sensors, and IoT devices to seamlessly collect, process, and send data to the cloud.
https://eclipse.dev/kura/
Eclipse Public License 2.0
506 stars 312 forks source link

feat(nm): add managed GPS mode #5406

Closed mattdibi closed 1 month ago

mattdibi commented 1 month ago

This PR adds a new mode for handling the modem's GPS, allowing ModemManager to take control of the serial port and thus open the way for us to create a new PositionProvider that retrieves the position information from ModemManager.

This new mode leverages the following two ModemManager location sources:

Once these two are enabled ModemManager will take control of the GPS communication and start parsing the data, allowing clients to retrieve the informations via the "GetLocation" DBus method.

Before this PR (see #4633) we were only using the MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED mode, which took care of setting up the GPS for the modem but left the serial connection free for other services to connect to (eg gpsd).

Note: to avoid breaking changes in the snapshot, instead of substituting the net.interface.[deviceId].config.gpsEnabled parameter with an enum, I left it untouched and added the net.interface.[deviceId].config.gpsMode parameter. It's a little bit more clunky to use but doesn't break snapshot compatibility with older versions. The gpsMode parameter is optional, when not specified it defaults to the UNMANAGED mode, preserving the current behaviour.

Since we added this new parameter, the isGpsSupported() method in Kura's API doesn't contain all the required informations anymore. We'll need to add to the APIs a new getSupportedGPSModes() method to know what mode we can set for the modem at hand. This new API will be introduced in a future separate PR.