This is the client for the LED Switch Service.
More...
This is the client for the LED Switch Service.
|
#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) |
|
|
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...
|
|
◆ e_ble_lsc_char_idx_t
LED Switch characteristic ID.
◆ e_ble_lsc_event_t
LED Switch client event type.
◆ 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_hdl | Connection 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_hdl | Connection handle. |
[in] | p_value | Switch State characteristic Client Characteristic Configuration descriptor value to write. |
- Returns
- ble_status_t
◆ R_BLE_LSC_GetSwitchStateAttrHdl()
Get Switch State attribute handles.
- Parameters
-
[in] | p_addr | Bluetooth device address for the attribute handles. |
[out] | p_hdl | The pointer to store the retrieved attribute handles. |
- Returns
- ble_status_t
◆ R_BLE_LSC_ReadBlinkRate()
Read LED Blink Rate characteristic value from the remote GATT database.
- Parameters
-
[in] | conn_hdl | Connection 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_hdl | Connection handle. |
[in] | p_value | LED Blink Rate characteristic value to write. |
- Returns
- ble_status_t
◆ R_BLE_LSC_GetBlinkRateAttrHdl()
Get LED Blink Rate attribute handles.
- Parameters
-
[in] | p_addr | Bluetooth device address for the attribute handles. |
[out] | p_hdl | The pointer to store the retrieved attribute handles. |
- Returns
- ble_status_t
◆ R_BLE_LSC_Init()
Initialize LED Switch client.
- Parameters
-
- 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_hdl | Connection handle |
[in] | serv_idx | Service instance index. |
[in] | type | Service discovery event type. |
[in] | p_param | Service discovery event parameter. |
- Returns
- ble_status_t
◆ R_BLE_LSC_GetServAttrHdl()
Get LED Switch client attribute handle.
- Parameters
-
[in] | p_addr | Bluetooth device address for the attribute handles. |
[out] | p_hdl | The pointer to store the retrieved attribute handles. |