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

This is the client for the LED Switch Service. More...

Detailed Description

This is the client for the LED Switch Service.

Data Structures

struct  st_ble_lsc_switch_state_attr_hdl_t
 Switch State attribute handle value. More...
 
struct  st_ble_lsc_blink_rate_attr_hdl_t
 LED Blink Rate attribute handle value. More...
 
struct  st_ble_lsc_evt_data_t
 LED Switch client event data. More...
 

Macros

#define BLE_LSC_SWITCH_STATE_LEN   (1)
 
#define BLE_LSC_SWITCH_STATE_CLI_CNFG_UUID   (0x2902)
 
#define BLE_LSC_SWITCH_STATE_CLI_CNFG_LEN   (2)
 
#define BLE_LSC_BLINK_RATE_LEN   (1)
 

Enumerations

enum  e_ble_lsc_char_idx_t {
  BLE_LSC_SWITCH_STATE_IDX,
  BLE_LSC_SWITCH_STATE_CLI_CNFG_IDX,
  BLE_LSC_BLINK_RATE_IDX
}
 LED Switch characteristic ID. More...
 
enum  e_ble_lsc_event_t {
  BLE_LSC_EVENT_SWITCH_STATE_HDL_VAL_NTF = BLE_SERVC_ATTR_EVENT(BLE_LSC_SWITCH_STATE_IDX, BLE_SERVC_HDL_VAL_NTF),
  BLE_LSC_EVENT_SWITCH_STATE_CLI_CNFG_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_LSC_SWITCH_STATE_CLI_CNFG_IDX, BLE_SERVC_READ_RSP),
  BLE_LSC_EVENT_SWITCH_STATE_CLI_CNFG_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_LSC_SWITCH_STATE_CLI_CNFG_IDX, BLE_SERVC_WRITE_RSP),
  BLE_LSC_EVENT_BLINK_RATE_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_LSC_BLINK_RATE_IDX, BLE_SERVC_READ_RSP),
  BLE_LSC_EVENT_BLINK_RATE_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_LSC_BLINK_RATE_IDX, BLE_SERVC_WRITE_RSP)
}
 LED Switch client event type. More...
 

Functions

ble_status_t R_BLE_LSC_ReadSwitchStateCliCnfg (uint16_t conn_hdl)
 Read Switch State characteristic Client Characteristic Configuration descriptor value from the remote GATT database. More...
 
ble_status_t R_BLE_LSC_WriteSwitchStateCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Write Switch State characteristic Client Characteristic Configuration descriptor value to remote GATT database. More...
 
void R_BLE_LSC_GetSwitchStateAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_lsc_switch_state_attr_hdl_t *p_hdl)
 Get Switch State attribute handles. More...
 
ble_status_t R_BLE_LSC_ReadBlinkRate (uint16_t conn_hdl)
 Read LED Blink Rate characteristic value from the remote GATT database. More...
 
ble_status_t R_BLE_LSC_WriteBlinkRate (uint16_t conn_hdl, const uint8_t *p_value)
 Write LED Blink Rate characteristic value to remote GATT database. More...
 
void R_BLE_LSC_GetBlinkRateAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_lsc_blink_rate_attr_hdl_t *p_hdl)
 Get LED Blink Rate attribute handles. More...
 
ble_status_t R_BLE_LSC_Init (ble_servc_app_cb_t cb)
 Initialize LED Switch client. More...
 
void R_BLE_LSC_ServDiscCb (uint16_t conn_hdl, uint8_t serv_idx, uint16_t type, void *p_param)
 LED Switch client discovery callback. More...
 
void R_BLE_LSC_GetServAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_gatt_hdl_range_t *p_hdl)
 Get LED Switch client attribute handle. More...
 

Variables

const uint8_t BLE_LSC_SWITCH_STATE_UUID [BLE_GATT_128_BIT_UUID_SIZE]
 
const uint8_t BLE_LSC_BLINK_RATE_UUID [BLE_GATT_128_BIT_UUID_SIZE]
 

Enumeration Type Documentation

◆ e_ble_lsc_char_idx_t

LED Switch characteristic ID.

◆ e_ble_lsc_event_t

LED Switch client event type.

Function Documentation

◆ R_BLE_LSC_ReadSwitchStateCliCnfg()

ble_status_t R_BLE_LSC_ReadSwitchStateCliCnfg ( uint16_t  conn_hdl)

Read Switch State characteristic Client Characteristic Configuration descriptor value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_LSC_WriteSwitchStateCliCnfg()

ble_status_t R_BLE_LSC_WriteSwitchStateCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Write Switch State characteristic Client Characteristic Configuration descriptor value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueSwitch State characteristic Client Characteristic Configuration descriptor value to write.
Returns
ble_status_t

◆ R_BLE_LSC_GetSwitchStateAttrHdl()

void R_BLE_LSC_GetSwitchStateAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_lsc_switch_state_attr_hdl_t p_hdl 
)

Get Switch State attribute handles.

Parameters
[in]p_addrBluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.
Returns
ble_status_t

◆ R_BLE_LSC_ReadBlinkRate()

ble_status_t R_BLE_LSC_ReadBlinkRate ( uint16_t  conn_hdl)

Read LED Blink Rate characteristic value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_LSC_WriteBlinkRate()

ble_status_t R_BLE_LSC_WriteBlinkRate ( uint16_t  conn_hdl,
const uint8_t *  p_value 
)

Write LED Blink Rate characteristic value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueLED Blink Rate characteristic value to write.
Returns
ble_status_t

◆ R_BLE_LSC_GetBlinkRateAttrHdl()

void R_BLE_LSC_GetBlinkRateAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_lsc_blink_rate_attr_hdl_t p_hdl 
)

Get LED Blink Rate attribute handles.

Parameters
[in]p_addrBluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.
Returns
ble_status_t

◆ R_BLE_LSC_Init()

ble_status_t R_BLE_LSC_Init ( ble_servc_app_cb_t  cb)

Initialize LED Switch client.

Parameters
[in]cbClient callback.
Returns
ble_status_t

◆ R_BLE_LSC_ServDiscCb()

void R_BLE_LSC_ServDiscCb ( uint16_t  conn_hdl,
uint8_t  serv_idx,
uint16_t  type,
void *  p_param 
)

LED Switch client discovery callback.

Parameters
[in]conn_hdlConnection handle
[in]serv_idxService instance index.
[in]typeService discovery event type.
[in]p_paramService discovery event parameter.
Returns
ble_status_t

◆ R_BLE_LSC_GetServAttrHdl()

void R_BLE_LSC_GetServAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_gatt_hdl_range_t p_hdl 
)

Get LED Switch client attribute handle.

Parameters
[in]p_addrBluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.