Location and Navigation Service module. More...
Data Structures | |
struct | ble_lns_mask_t |
A mask can be used to temporarily enable and disable features of the Location and Speed characteristic. More... | |
struct | ble_lns_evt_t |
Location and Navigation event structure. When an event occurs, the data structures of the module are automatically updated. More... | |
struct | ble_lns_init_s |
Location and Navigation Service init structure. This structure contains all options and data needed to initialize the service. More... | |
struct | ble_lns_routes_s |
Definition of a navigation route. More... | |
struct | ble_lns_ctrlpt_response_t |
Information included in a control point write response indication. More... | |
struct | ble_lns_s |
Location and Navigation Service structure. This structure contains various status information for the service. More... | |
struct | ble_lns_loc_speed_s |
Location and Speed data structure. More... | |
struct | ble_lns_pos_quality_s |
Position quality structure. More... | |
struct | ble_lns_navigation_s |
Navigation data structure. More... | |
Typedefs | |
typedef struct ble_lns_init_s | ble_lns_init_t |
typedef struct ble_lns_s | ble_lns_t |
typedef struct ble_lns_loc_speed_s | ble_lns_loc_speed_t |
typedef struct ble_lns_pos_quality_s | ble_lns_pos_quality_t |
typedef struct ble_lns_navigation_s | ble_lns_navigation_t |
typedef void(* | ble_lns_evt_handler_t )(ble_lns_t *p_lns, ble_lns_evt_t *p_evt) |
Location and Navigation Service event handler type. | |
typedef struct ble_lns_routes_s | ble_lns_route_t |
Definition of a navigation route. | |
Functions | |
uint32_t | ble_lns_init (ble_lns_t *p_lns, const ble_lns_init_t *p_lns_init) |
Function for initializing the Location and Navigation Service. More... | |
void | ble_lns_on_ble_evt (ble_lns_t *p_lns, ble_evt_t *p_ble_evt) |
Function for handling Location and Navigation Service BLE stack events. More... | |
uint32_t | ble_lns_loc_speed_send (ble_lns_t *p_lns) |
Function for sending location and speed data if notification has been enabled. More... | |
uint32_t | ble_lns_navigation_send (ble_lns_t *p_lns) |
Function for sending navigation data if notification has been enabled. More... | |
uint32_t | ble_lns_add_route (ble_lns_t *p_lns, ble_lns_route_t *p_route) |
Function for adding a route to the Location and Navigation Service. More... | |
uint32_t | ble_lns_remove_route (ble_lns_t *p_lns, uint16_t route_id) |
Function for removing a route from the Location and Navigation Service. More... | |
Location and Navigation Service module.
This module implements the Location and Navigation Service with the Location and Speed, Position Quality, Feature, Control Point, and Navigation characteristics.
If an event handler is supplied by the application, the Location and Navigation Service will generate Location and Navigation Service events to the application.
#define BLE_LNS_FEATURE_ELEVATION_SETTING_SUPPORTED (0x01 << 19) |
Elevation Setting Supported bit.
#define BLE_LNS_FEATURE_ELEVATION_SUPPORTED (0x01 << 3) |
Elevation Supported bit.
#define BLE_LNS_FEATURE_EST_HORZ_POS_ERROR_SUPPORTED (0x01 << 13) |
Estimated Horizontal Position Error Supported bit.
#define BLE_LNS_FEATURE_EST_TIME_OF_ARRIVAL_SUPPORTED (0x01 << 9) |
Estimated Time of Arrival Supported bit.
#define BLE_LNS_FEATURE_EST_VERT_POS_ERROR_SUPPORTED (0x01 << 14) |
Estimated Vertical Position Error Supported bit.
#define BLE_LNS_FEATURE_FIX_RATE_SETTING_SUPPORTED (0x01 << 18) |
Fix Rate Setting Supported bit.
#define BLE_LNS_FEATURE_HEADING_SUPPORTED (0x01 << 4) |
Heading Supported bit.
#define BLE_LNS_FEATURE_HORZ_DILUTION_OF_PRECISION_SUPPORTED (0x01 << 15) |
Horizontal Dilution of Precision Supported bit.
#define BLE_LNS_FEATURE_INSTANT_SPEED_SUPPORTED (0x01 << 0) |
Instaneous Speed Supported bit.
#define BLE_LNS_FEATURE_LOC_AND_SPEED_CONTENT_MASKING_SUPPORTED (0x01 << 17) |
Location and Speed Characteristic Content Masking Supported bit.
#define BLE_LNS_FEATURE_LOCATION_SUPPORTED (0x01 << 2) |
Location Supported bit.
#define BLE_LNS_FEATURE_NUM_SATS_IN_SOLUTION_SUPPORTED (0x01 << 10) |
Number of Satellites in Solution Supported bit.
#define BLE_LNS_FEATURE_NUM_SATS_IN_VIEW_SUPPORTED (0x01 << 11) |
Number of Satellites in View Supported bit.
#define BLE_LNS_FEATURE_POSITION_STATUS_SUPPORTED (0x01 << 20) |
Position Status Supported bit.
#define BLE_LNS_FEATURE_REMAINING_DISTANCE_SUPPORTED (0x01 << 7) |
Remaining Distance Supported bit.
#define BLE_LNS_FEATURE_REMAINING_VERT_DISTANCE_SUPPORTED (0x01 << 8) |
Remaining Vertical Distance Supported bit.
#define BLE_LNS_FEATURE_ROLLING_TIME_SUPPORTED (0x01 << 5) |
Rolling Time Supported bit.
#define BLE_LNS_FEATURE_TIME_TO_FIRST_FIX_SUPPORTED (0x01 << 12) |
Time to First Fix Supported bit.
#define BLE_LNS_FEATURE_TOTAL_DISTANCE_SUPPORTED (0x01 << 1) |
Total Distance Supported bit.
#define BLE_LNS_FEATURE_UTC_TIME_SUPPORTED (0x01 << 6) |
UTC Time Supported bit.
#define BLE_LNS_FEATURE_VERT_DILUTION_OF_PRECISION_SUPPORTED (0x01 << 16) |
Vertical Dilution of Precision Supported bit.
#define BLE_LNS_MAX_NUM_ROUTES 3 |
The maximum number of routes. This affects memory usage only.
#define BLE_LNS_MAX_ROUTE_NAME_LEN (BLE_L2CAP_MTU_DEF-5) |
The maximum length of length of a route name.
Location and Navigation Control Point procedure status (indicates if a procedure is in progress or not and which procedure is in progress).
enum ble_lns_evt_type_t |
Location and Navigation event type. This list defines the possible events types from the Location and Navigation Service.
Navigation commands. These commands can be sent to the control point and returned by an event callback.
Enumerator | |
---|---|
BLE_LNS_NAVIGATION_STOP |
When received, is_navigation_running in ble_lns_s will be set to false. |
BLE_LNS_NAVIGATION_START |
When received, is_navigation_running in ble_lns_s will be set to true. |
BLE_LNS_NAVIGATION_PAUSE |
When received, is_navigation_running in ble_lns_s will be set to false. |
BLE_LNS_NAVIGATION_CONTINUE |
When received, is_navigation_running in ble_lns_s will be set to true. |
BLE_LNS_NAVIGATION_SKIP_WAYPOINT |
When received, is_navigation_running in ble_lns_s will not be affected. |
BLE_LNS_NAVIGATION_NEAREST |
When received, is_navigation_running in ble_lns_s will be set to true. |
uint32_t ble_lns_add_route | ( | ble_lns_t * | p_lns, |
ble_lns_route_t * | p_route | ||
) |
Function for adding a route to the Location and Navigation Service.
[in] | p_lns | Location and Navigation Service structure. |
[in,out] | p_route | The new route to be added. The route ID is updated. |
NRF_SUCCESS | If the route was added successfully. |
NRF_ERROR_NULL | If a NULL parameter was provided. |
NRF_ERROR_NOT_SUPPORTED | If the navigation characteristic is absent. |
NRF_ERROR_NO_MEM | If there is no memory left. |
NRF_ERROR_INTERNAL | If there is an inconsistency in the routes table. |
uint32_t ble_lns_init | ( | ble_lns_t * | p_lns, |
const ble_lns_init_t * | p_lns_init | ||
) |
Function for initializing the Location and Navigation Service.
[out] | p_lns | Location and Navigation Service structure. This structure must be supplied by the application. It is initialized by this function, and will later be used to identify this particular service instance. |
[in] | p_lns_init | Information needed to initialize the service. |
NRF_SUCCESS | If the service was initialized successfully. |
NRF_ERROR_NULL | If a NULL parameter was provided. |
NRF_INVALID_PARAMS | If there is an inconsistency in the initialization structure. |
uint32_t ble_lns_loc_speed_send | ( | ble_lns_t * | p_lns | ) |
Function for sending location and speed data if notification has been enabled.
The application calls this function after having performed a location and speed determination. If notification has been enabled, the location and speed data is encoded and sent to the client.
[in] | p_lns | Location and Navigation Service structure holding the location and speed data. |
NRF_SUCCESS | If the data was sent successfully. |
NRF_ERROR_NULL | If a NULL parameter was provided. |
NRF_ERROR_INVALID_STATE | If notification is disabled. |
uint32_t ble_lns_navigation_send | ( | ble_lns_t * | p_lns | ) |
Function for sending navigation data if notification has been enabled.
The application calls this function after having performed a navigation determination. If notification has been enabled, the navigation data is encoded and sent to the client.
[in] | p_lns | Location and Navigation Service structure holding the navigation data. |
NRF_SUCCESS | If the data was sent successfully. |
NRF_ERROR_NULL | If a NULL parameter was provided. |
NRF_ERROR_NOT_SUPPORTED | If the navigation characteristic is absent. |
NRF_ERROR_INVALID_STATE | If navigation is not running or notification is disabled. |
Function for handling Location and Navigation Service BLE stack events.
This function handles all events from the BLE stack that are of interest to the Location and Navigation Service.
[in] | p_lns | Location and Navigation Service structure. |
[in] | p_ble_evt | Event received from the BLE stack. |
uint32_t ble_lns_remove_route | ( | ble_lns_t * | p_lns, |
uint16_t | route_id | ||
) |
Function for removing a route from the Location and Navigation Service.
[in] | p_lns | Location and Navigation Service structure. |
[in] | route_id | The ID of the route to be removed. |
NRF_SUCCESS | If the route was removed successfully. |
NRF_ERROR_NULL | If a NULL parameter was provided. |
NRF_ERROR_NOT_SUPPORTED | If the navigation characteristic is absent. |
NRF_INVALID_PARAM | If the route ID does not exist. |