Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
LED Switch Service Server

This service exposes a control point to allow a peer device to control LEDs and switched on the device. More...

Detailed Description

This service exposes a control point to allow a peer device to control LEDs and switched on the device.

Enumerations

enum  e_ble_lss_char_idx_t {
  BLE_LSS_SWITCH_STATE_IDX,
  BLE_LSS_SWITCH_STATE_CLI_CNFG_IDX,
  BLE_LSS_BLINK_RATE_IDX
}
 LED Switch characteristic Index. More...
 
enum  e_ble_lss_event_t {
  BLE_LSS_EVENT_SWITCH_STATE_CLI_CNFG_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_LSS_SWITCH_STATE_CLI_CNFG_IDX, BLE_SERVS_WRITE_REQ),
  BLE_LSS_EVENT_SWITCH_STATE_CLI_CNFG_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_LSS_SWITCH_STATE_CLI_CNFG_IDX, BLE_SERVS_WRITE_COMP),
  BLE_LSS_EVENT_SWITCH_STATE_CLI_CNFG_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_LSS_SWITCH_STATE_CLI_CNFG_IDX, BLE_SERVS_READ_REQ),
  BLE_LSS_EVENT_BLINK_RATE_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_LSS_BLINK_RATE_IDX, BLE_SERVS_WRITE_REQ),
  BLE_LSS_EVENT_BLINK_RATE_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_LSS_BLINK_RATE_IDX, BLE_SERVS_WRITE_COMP),
  BLE_LSS_EVENT_BLINK_RATE_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_LSS_BLINK_RATE_IDX, BLE_SERVS_READ_REQ)
}
 LED Switch event type. More...
 

Functions

ble_status_t R_BLE_LSS_NotifySwitchState (uint16_t conn_hdl, const uint8_t *p_value)
 Send notification of Switch State characteristic value to the remote device. More...
 
ble_status_t R_BLE_LSS_SetSwitchStateCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Set Switch State cli cnfg descriptor value to the local GATT database. More...
 
ble_status_t R_BLE_LSS_GetSwitchStateCliCnfg (uint16_t conn_hdl, uint16_t *p_value)
 Get Switch State cli cnfg descriptor value from the local GATT database. More...
 
ble_status_t R_BLE_LSS_SetBlinkRate (const uint8_t *p_value)
 Set LED Blink Rate characteristic value to the local GATT database. More...
 
ble_status_t R_BLE_LSS_GetBlinkRate (uint8_t *p_value)
 Get LED Blink Rate characteristic value from the local GATT database. More...
 
ble_status_t R_BLE_LSS_Init (ble_servs_app_cb_t cb)
 Initialize LED Switch service. More...
 

Enumeration Type Documentation

◆ e_ble_lss_char_idx_t

LED Switch characteristic Index.

◆ e_ble_lss_event_t

LED Switch event type.

Function Documentation

◆ R_BLE_LSS_NotifySwitchState()

ble_status_t R_BLE_LSS_NotifySwitchState ( uint16_t  conn_hdl,
const uint8_t *  p_value 
)

Send notification of Switch State characteristic value to the remote device.

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

◆ R_BLE_LSS_SetSwitchStateCliCnfg()

ble_status_t R_BLE_LSS_SetSwitchStateCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Set Switch State 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_LSS_GetSwitchStateCliCnfg()

ble_status_t R_BLE_LSS_GetSwitchStateCliCnfg ( uint16_t  conn_hdl,
uint16_t *  p_value 
)

Get Switch State 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_LSS_SetBlinkRate()

ble_status_t R_BLE_LSS_SetBlinkRate ( const uint8_t *  p_value)

Set LED Blink Rate characteristic value to the local GATT database.

Parameters
[in]p_valueCharacteristic value to set.
Returns
ble_status_t

◆ R_BLE_LSS_GetBlinkRate()

ble_status_t R_BLE_LSS_GetBlinkRate ( uint8_t *  p_value)

Get LED Blink Rate characteristic value from the local GATT database.

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

◆ R_BLE_LSS_Init()

ble_status_t R_BLE_LSS_Init ( ble_servs_app_cb_t  cb)

Initialize LED Switch service.

Parameters
[in]cbService callback.
Returns
ble_status_t