nRF Connect SDK API 2.8.99
|
int location_request | ( | const struct location_config * | config | ) |
#include <include/modem/location.h>
Requests the current position or starts periodic position updates.
Requests the current position using the given configuration. Depending on the configuration, a single position or periodic position updates are given. If the position request is successful, the results are delivered to the event handler function in LOCATION_EVT_LOCATION event. Otherwise LOCATION_EVT_TIMEOUT or LOCATION_EVT_ERROR event is triggered.
In periodic mode, position update is always attempted after the configured interval regardless of the outcome of any previous attempt. Periodic position updates can be stopped by calling location_cancel().
[in] | config | Used configuration or NULL to get a single position update with the default configuration. Default configuration has the following location methods in priority order (if they are enabled in library configuration): GNSS, Wi-Fi and Cellular. |
-EPERM | Library not initialized. |
-EBUSY | Previous location request still ongoing. |
-EINVAL | Invalid configuration given. |