SG RFID nRF51822 fork
Fork of nRF51822 by
Functions
[Battery Service Client]
Functions | |
uint32_t | ble_bas_c_init (ble_bas_c_t *p_ble_bas_c, ble_bas_c_init_t *p_ble_bas_c_init) |
Function for initializing the Battery Service Client module. | |
void | ble_bas_c_on_ble_evt (ble_bas_c_t *p_ble_bas_c, const ble_evt_t *p_ble_evt) |
Function for handling BLE events from the SoftDevice. | |
uint32_t | ble_bas_c_bl_notif_enable (ble_bas_c_t *p_ble_bas_c) |
Function for enabling notifications on the Battery Level characteristic. | |
uint32_t | ble_bas_c_bl_read (ble_bas_c_t *p_ble_bas_c) |
Function for reading the Battery Level characteristic. |
Function Documentation
uint32_t ble_bas_c_bl_notif_enable | ( | ble_bas_c_t * | p_ble_bas_c ) |
Function for enabling notifications on the Battery Level characteristic.
This function will enable to notification of the Battery Level characteristic at the peer by writing to the CCCD of the Battery Level Characteristic.
- Parameters:
-
p_ble_bas_c Pointer to the Battery Service client structure.
- Return values:
-
NRF_SUCCESS If the SoftDevice has been requested to write to the CCCD of the peer. NRF_ERROR_NULL Parameter is NULL. Otherwise, an error code returned by the SoftDevice API sd_ble_gattc_write.
uint32_t ble_bas_c_bl_read | ( | ble_bas_c_t * | p_ble_bas_c ) |
Function for reading the Battery Level characteristic.
- Parameters:
-
p_ble_bas_c Pointer to the Battery Service client structure.
- Return values:
-
NRF_SUCCESS If the read request was successfully queued to be sent to peer.
uint32_t ble_bas_c_init | ( | ble_bas_c_t * | p_ble_bas_c, |
ble_bas_c_init_t * | p_ble_bas_c_init | ||
) |
Function for initializing the Battery Service Client module.
This function will initialize the module and set up Database Discovery to discover the Battery Service. After calling this function, call ble_db_discovery_start to start discovery.
- Parameters:
-
[out] p_ble_bas_c Pointer to the Battery Service client structure. [in] p_ble_bas_c_init Pointer to the Battery Service initialization structure containing the initialization information.
- Return values:
-
NRF_SUCCESS Operation success. NRF_ERROR_NULL A parameter is NULL. Otherwise, an error code returned by ble_db_discovery_register.
void ble_bas_c_on_ble_evt | ( | ble_bas_c_t * | p_ble_bas_c, |
const ble_evt_t * | p_ble_evt | ||
) |
Function for handling BLE events from the SoftDevice.
This function will handle the BLE events received from the SoftDevice. If the BLE event is relevant for the Battery Service Client module, then it is used to update interval variables and, if necessary, send events to the application.
- Note:
- This function must be called by the application.
- Parameters:
-
[in] p_ble_bas_c Pointer to the Battery Service client structure. [in] p_ble_evt Pointer to the BLE event.
Generated on Tue Jul 12 2022 15:07:45 by 1.7.2