Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
Location and Navigation Service Server

This service exposes location and navigation-related data from a Location and Navigation sensor intended for outdoor activity applications. More...

Detailed Description

This service exposes location and navigation-related data from a Location and Navigation sensor intended for outdoor activity applications.

Data Structures

struct  st_ble_lns_feat_t
 LN Feature value structure. More...
 
struct  st_ble_lns_location_and_speed_flags_t
 Location and Speed Flags value structure. More...
 
struct  st_ble_lns_location_and_speed_t
 Location and Speed value structure. More...
 
struct  st_ble_lns_position_quality_flags_t
 Position Quality Flags value structure. More...
 
struct  st_ble_lns_position_quality_t
 Position Quality value structure. More...
 
struct  st_ble_lns_cp_t
 LN Control Point value structure. More...
 
struct  st_ble_lns_navigation_flags_t
 Navigation Flags value structure. More...
 
struct  st_ble_lns_navigation_t
 Navigation value structure. More...
 

Macros

#define LOCATION_AND_SPEED_SUPPORTED   (1)
 
#define NAVIGATION_SUPPORTED   (1)
 

Enumerations

enum  e_ble_lns_cp_op_codes_t {
  BLE_LNS_CP_OP_CODES_SET_CUMULATIVE_VALUE = 1,
  BLE_LNS_CP_OP_CODES_MASK_LOCATION_AND_SPEED_CHARACTERISTIC_CONTENT = 2,
  BLE_LNS_CP_OP_CODES_NAVIGATION_CONTROL = 3,
  BLE_LNS_CP_OP_CODES_REQUEST_NUMBER_OF_ROUTES = 4,
  BLE_LNS_CP_OP_CODES_REQUEST_NAME_OF_ROUTE = 5,
  BLE_LNS_CP_OP_CODES_SELECT_ROUTE = 6,
  BLE_LNS_CP_OP_CODES_SET_FIX_RATE = 7,
  BLE_LNS_CP_OP_CODES_SET_ELEVATION = 8,
  BLE_LNS_CP_OP_CODES_RESPONSE_CODE = 32
}
 LN Control Point Op Codes enumeration. More...
 
enum  e_ble_lns_cp_response_value_t {
  BLE_LNS_CP_RESPONSE_VALUE_SUCCESS = 1,
  BLE_LNS_CP_RESPONSE_VALUE_OP_CODE_NOT_SUPPORTED = 2,
  BLE_LNS_CP_RESPONSE_VALUE_INVALID_PARAMETER = 3,
  BLE_LNS_CP_RESPONSE_VALUE_OPERATION_FAILED = 4
}
 LN Control Point Response Value enumeration. More...
 
enum  e_ble_lns_cp_navigation_control_value_t {
  BLE_LNS_CP_NAVIGATION_CONTROL_VALUE_STOP_NAVIGATION = 0,
  BLE_LNS_CP_NAVIGATION_CONTROL_VALUE_START_NAVIGATION = 1,
  BLE_LNS_CP_NAVIGATION_CONTROL_VALUE_PAUSE_NAVIGATION = 2,
  BLE_LNS_CP_NAVIGATION_CONTROL_VALUE_CONTINUE_NAVIGATION = 3,
  BLE_LNS_CP_NAVIGATION_CONTROL_VALUE_SKIP_WAYPOINT = 4,
  BLE_LNS_CP_NAVIGATION_CONTROL_VALUE_SELECT_NEAREST_WAYPOINT_ON_A_ROUTE = 5
}
 LN Control Point Navigation Control Value enumeration. More...
 
enum  e_ble_lns_char_idx_t {
  BLE_LNS_FEAT_IDX,
  BLE_LNS_LOCATION_AND_SPEED_IDX,
  BLE_LNS_LOCATION_AND_SPEED_CLI_CNFG_IDX,
  BLE_LNS_POSITION_QUALITY_IDX,
  BLE_LNS_CP_IDX,
  BLE_LNS_CP_CLI_CNFG_IDX,
  BLE_LNS_NAVIGATION_IDX,
  BLE_LNS_NAVIGATION_CLI_CNFG_IDX
}
 Location and Navigation characteristic Index. More...
 
enum  e_ble_lns_event_t {
  BLE_LNS_EVENT_FEAT_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_LNS_FEAT_IDX, BLE_SERVS_READ_REQ),
  BLE_LNS_EVENT_LOCATION_AND_SPEED_CLI_CNFG_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_LNS_LOCATION_AND_SPEED_CLI_CNFG_IDX, BLE_SERVS_WRITE_REQ),
  BLE_LNS_EVENT_LOCATION_AND_SPEED_CLI_CNFG_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_LNS_LOCATION_AND_SPEED_CLI_CNFG_IDX, BLE_SERVS_WRITE_COMP),
  BLE_LNS_EVENT_LOCATION_AND_SPEED_CLI_CNFG_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_LNS_LOCATION_AND_SPEED_CLI_CNFG_IDX, BLE_SERVS_READ_REQ),
  BLE_LNS_EVENT_POSITION_QUALITY_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_LNS_POSITION_QUALITY_IDX, BLE_SERVS_READ_REQ),
  BLE_LNS_EVENT_CP_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_LNS_CP_IDX, BLE_SERVS_WRITE_REQ),
  BLE_LNS_EVENT_CP_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_LNS_CP_IDX, BLE_SERVS_WRITE_COMP),
  BLE_LNS_EVENT_CP_HDL_VAL_CNF = BLE_SERVS_ATTR_EVENT(BLE_LNS_CP_IDX, BLE_SERVS_HDL_VAL_CNF),
  BLE_LNS_EVENT_CP_CLI_CNFG_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_LNS_CP_CLI_CNFG_IDX, BLE_SERVS_WRITE_REQ),
  BLE_LNS_EVENT_CP_CLI_CNFG_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_LNS_CP_CLI_CNFG_IDX, BLE_SERVS_WRITE_COMP),
  BLE_LNS_EVENT_CP_CLI_CNFG_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_LNS_CP_CLI_CNFG_IDX, BLE_SERVS_READ_REQ),
  BLE_LNS_EVENT_NAVIGATION_CLI_CNFG_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_LNS_NAVIGATION_CLI_CNFG_IDX, BLE_SERVS_WRITE_REQ),
  BLE_LNS_EVENT_NAVIGATION_CLI_CNFG_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_LNS_NAVIGATION_CLI_CNFG_IDX, BLE_SERVS_WRITE_COMP),
  BLE_LNS_EVENT_NAVIGATION_CLI_CNFG_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_LNS_NAVIGATION_CLI_CNFG_IDX, BLE_SERVS_READ_REQ)
}
 Location and Navigation event type. More...
 

Functions

ble_status_t R_BLE_LNS_SetFeat (const st_ble_lns_feat_t *p_value)
 Set LN Feature characteristic value to the local GATT database. More...
 
ble_status_t R_BLE_LNS_GetFeat (st_ble_lns_feat_t *p_value)
 Get LN Feature characteristic value from the local GATT database. More...
 
ble_status_t R_BLE_LNS_NotifyLocationAndSpeed (uint16_t conn_hdl, const st_ble_lns_location_and_speed_t *p_value)
 Send notification of Location and Speed characteristic value to the remote device. More...
 
ble_status_t R_BLE_LNS_SetLocationAndSpeedCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Set Location and Speed cli cnfg descriptor value to the local GATT database. More...
 
ble_status_t R_BLE_LNS_GetLocationAndSpeedCliCnfg (uint16_t conn_hdl, uint16_t *p_value)
 Get Location and Speed cli cnfg descriptor value from the local GATT database. More...
 
ble_status_t R_BLE_LNS_SetPositionQuality (const st_ble_lns_position_quality_t *p_value)
 Set Position Quality characteristic value to the local GATT database. More...
 
ble_status_t R_BLE_LNS_GetPositionQuality (st_ble_lns_position_quality_t *p_value)
 Get Position Quality characteristic value from the local GATT database. More...
 
ble_status_t R_BLE_LNS_IndicateCp (uint16_t conn_hdl, const st_ble_lns_cp_t *p_value)
 Send indication of LN Control Point characteristic value to the remote device. More...
 
ble_status_t R_BLE_LNS_SetCpCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Set LN Control Point cli cnfg descriptor value to the local GATT database. More...
 
ble_status_t R_BLE_LNS_GetCpCliCnfg (uint16_t conn_hdl, uint16_t *p_value)
 Get LN Control Point cli cnfg descriptor value from the local GATT database. More...
 
ble_status_t R_BLE_LNS_NotifyNavigation (uint16_t conn_hdl, const st_ble_lns_navigation_t *p_value)
 Send notification of Navigation characteristic value to the remote device. More...
 
ble_status_t R_BLE_LNS_SetNavigationCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Set Navigation cli cnfg descriptor value to the local GATT database. More...
 
ble_status_t R_BLE_LNS_GetNavigationCliCnfg (uint16_t conn_hdl, uint16_t *p_value)
 Get Navigation cli cnfg descriptor value from the local GATT database. More...
 
ble_status_t R_BLE_LNS_Init (ble_servs_app_cb_t cb)
 Initialize Location and Navigation service. More...
 
ble_status_t R_BLE_LNS_SetMtu (uint16_t *mtu)
 Set current MTU to check Notification. More...
 

Enumeration Type Documentation

◆ e_ble_lns_cp_op_codes_t

LN Control Point Op Codes enumeration.

Enumerator
BLE_LNS_CP_OP_CODES_SET_CUMULATIVE_VALUE 

Set Cumulative Value

BLE_LNS_CP_OP_CODES_MASK_LOCATION_AND_SPEED_CHARACTERISTIC_CONTENT 

Mask Location and Speed Characteristic Content

BLE_LNS_CP_OP_CODES_NAVIGATION_CONTROL 

Navigation Control

BLE_LNS_CP_OP_CODES_REQUEST_NUMBER_OF_ROUTES 

Request Number of Routes

BLE_LNS_CP_OP_CODES_REQUEST_NAME_OF_ROUTE 

Request Name of Route

BLE_LNS_CP_OP_CODES_SELECT_ROUTE 

Select Route

BLE_LNS_CP_OP_CODES_SET_FIX_RATE 

Set Fix Rate

BLE_LNS_CP_OP_CODES_SET_ELEVATION 

Set Elevation

BLE_LNS_CP_OP_CODES_RESPONSE_CODE 

Response Code

◆ e_ble_lns_cp_response_value_t

LN Control Point Response Value enumeration.

Enumerator
BLE_LNS_CP_RESPONSE_VALUE_SUCCESS 

Success

BLE_LNS_CP_RESPONSE_VALUE_OP_CODE_NOT_SUPPORTED 

Op Code not Supported

BLE_LNS_CP_RESPONSE_VALUE_INVALID_PARAMETER 

Invalid Parameter

BLE_LNS_CP_RESPONSE_VALUE_OPERATION_FAILED 

Operation Failed

◆ e_ble_lns_cp_navigation_control_value_t

LN Control Point Navigation Control Value enumeration.

◆ e_ble_lns_char_idx_t

Location and Navigation characteristic Index.

◆ e_ble_lns_event_t

Location and Navigation event type.

Function Documentation

◆ R_BLE_LNS_SetFeat()

ble_status_t R_BLE_LNS_SetFeat ( const st_ble_lns_feat_t p_value)

Set LN Feature characteristic value to the local GATT database.

Parameters
[in]p_valueCharacteristic value to set.
Returns
ble_status_t

◆ R_BLE_LNS_GetFeat()

ble_status_t R_BLE_LNS_GetFeat ( st_ble_lns_feat_t p_value)

Get LN Feature characteristic value from the local GATT database.

Parameters
[in]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_LNS_NotifyLocationAndSpeed()

ble_status_t R_BLE_LNS_NotifyLocationAndSpeed ( uint16_t  conn_hdl,
const st_ble_lns_location_and_speed_t p_value 
)

Send notification of Location and Speed characteristic value to the remote device.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueCharacteristic value to send.
Returns
ble_status_t

◆ R_BLE_LNS_SetLocationAndSpeedCliCnfg()

ble_status_t R_BLE_LNS_SetLocationAndSpeedCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Set Location and Speed cli cnfg descriptor value to the local GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueDescriptor value to set.
Returns
ble_status_t

◆ R_BLE_LNS_GetLocationAndSpeedCliCnfg()

ble_status_t R_BLE_LNS_GetLocationAndSpeedCliCnfg ( uint16_t  conn_hdl,
uint16_t *  p_value 
)

Get Location and Speed cli cnfg descriptor value from the local GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_LNS_SetPositionQuality()

ble_status_t R_BLE_LNS_SetPositionQuality ( const st_ble_lns_position_quality_t p_value)

Set Position Quality characteristic value to the local GATT database.

Parameters
[in]p_valueCharacteristic value to set.
Returns
ble_status_t

◆ R_BLE_LNS_GetPositionQuality()

ble_status_t R_BLE_LNS_GetPositionQuality ( st_ble_lns_position_quality_t p_value)

Get Position Quality characteristic value from the local GATT database.

Parameters
[in]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_LNS_IndicateCp()

ble_status_t R_BLE_LNS_IndicateCp ( uint16_t  conn_hdl,
const st_ble_lns_cp_t p_value 
)

Send indication of LN Control Point characteristic value to the remote device.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueCharacteristic value to send.
Returns
ble_status_t

◆ R_BLE_LNS_SetCpCliCnfg()

ble_status_t R_BLE_LNS_SetCpCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Set LN Control Point cli cnfg descriptor value to the local GATT database.

Parameters
[in]p_valueDescriptor value to set.
Returns
ble_status_t

◆ R_BLE_LNS_GetCpCliCnfg()

ble_status_t R_BLE_LNS_GetCpCliCnfg ( uint16_t  conn_hdl,
uint16_t *  p_value 
)

Get LN Control Point cli cnfg descriptor value from the local GATT database.

Parameters
[in]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_LNS_NotifyNavigation()

ble_status_t R_BLE_LNS_NotifyNavigation ( uint16_t  conn_hdl,
const st_ble_lns_navigation_t p_value 
)

Send notification of Navigation characteristic value to the remote device.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueCharacteristic value to send.
Returns
ble_status_t

◆ R_BLE_LNS_SetNavigationCliCnfg()

ble_status_t R_BLE_LNS_SetNavigationCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Set Navigation cli cnfg descriptor value to the local GATT database.

Parameters
[in]p_valueDescriptor value to set.
Returns
ble_status_t

◆ R_BLE_LNS_GetNavigationCliCnfg()

ble_status_t R_BLE_LNS_GetNavigationCliCnfg ( uint16_t  conn_hdl,
uint16_t *  p_value 
)

Get Navigation cli cnfg descriptor value from the local GATT database.

Parameters
[in]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_LNS_Init()

ble_status_t R_BLE_LNS_Init ( ble_servs_app_cb_t  cb)

Initialize Location and Navigation service.

Parameters
[in]cbService callback.
Returns
ble_status_t

◆ R_BLE_LNS_SetMtu()

ble_status_t R_BLE_LNS_SetMtu ( uint16_t *  mtu)

Set current MTU to check Notification.

Parameters
[in]mtuMTU value to set.
Returns
ble_status_t