The following states are used by the module:
-
STATE_RUNNING: Parent state entered on initialization. Its entry function initializes the Location library and publishes
LOCATION_MODULE_READY.- STATE_LOCATION_SEARCH_INACTIVE: Default substate, in which no search is running. A
LOCATION_SEARCH_TRIGGERstarts a search withlocation_request(), and the module only moves to the active state if that call succeeds. A failed request is reported as a completed search withLOCATION_SEARCH_DONE, so the application is not left waiting. - STATE_LOCATION_SEARCH_ACTIVE: A Wi-Fi scan is running. Further triggers are ignored. A
LOCATION_SEARCH_CANCELcancels the request and completes the search by publishingLOCATION_SEARCH_DONE.
- STATE_LOCATION_SEARCH_INACTIVE: Default substate, in which no search is running. A
Search results arrive asynchronously from the Location library. Location found, timeout, error, and unknown result all lead to LOCATION_SEARCH_DONE, which returns the module to the inactive state.