test
Fork of nrf51-sdk by
Common service definitions
Constants, type definitions, and functions that are common to all services. More...
Data Structures | |
struct | ble_srv_report_ref_t |
Value of a Report Reference descriptor. More... | |
struct | ble_srv_utf8_str_t |
UTF-8 string data type. More... | |
struct | ble_srv_security_mode_t |
Security settings structure. More... | |
struct | ble_srv_cccd_security_mode_t |
Security settings structure. More... | |
struct | ble_add_char_user_desc_t |
Characteristic User Descriptor parameters. More... | |
struct | ble_add_char_params_t |
Add characteristic parameters structure. More... | |
struct | ble_add_descr_params_t |
Add descriptor parameters structure. More... | |
Modules | |
Service UUID definitions | |
Characteristic UUID definitions | |
Definitions for the Alert Level characteristic values | |
Typedefs | |
typedef void(* | ble_srv_error_handler_t )(uint32_t nrf_error) |
Type definition for error handler function that will be called in case of an error in a service or a service library module. | |
Enumerations | |
enum | security_req_t { SEC_NO_ACCESS = 0, SEC_OPEN = 1, SEC_JUST_WORKS = 2, SEC_MITM = 3, SEC_SIGNED = 4, SEC_SIGNED_MITM = 5 } |
Security Access enumeration. More... | |
Functions | |
static __INLINE bool | ble_srv_is_notification_enabled (uint8_t *p_encoded_data) |
Function for decoding a CCCD value, and then testing if notification is enabled. | |
static __INLINE bool | ble_srv_is_indication_enabled (uint8_t *p_encoded_data) |
Function for decoding a CCCD value, and then testing if indication is enabled. | |
uint8_t | ble_srv_report_ref_encode (uint8_t *p_encoded_buffer, const ble_srv_report_ref_t *p_report_ref) |
Function for encoding a Report Reference Descriptor. | |
void | ble_srv_ascii_to_utf8 (ble_srv_utf8_str_t *p_utf8, char *p_ascii) |
Function for making a UTF-8 structure refer to an ASCII string. | |
uint32_t | characteristic_add (uint16_t service_handle, ble_add_char_params_t *p_char_props, ble_gatts_char_handles_t *p_char_handle) |
Function for adding a characteristic to a given service. | |
uint32_t | descriptor_add (uint16_t char_handle, ble_add_descr_params_t *p_descr_props, uint16_t *p_descr_handle) |
Function for adding a characteristic's descriptor to a given characteristic. |
Detailed Description
Constants, type definitions, and functions that are common to all services.
Typedef Documentation
typedef void(* ble_srv_error_handler_t)(uint32_t nrf_error) |
Type definition for error handler function that will be called in case of an error in a service or a service library module.
Definition at line 169 of file ble_srv_common.h.
Enumeration Type Documentation
enum security_req_t |
Security Access enumeration.
This enumeration gives the possible requirements for accessing a characteristic value.
- Enumerator:
Definition at line 265 of file ble_srv_common.h.
Function Documentation
void ble_srv_ascii_to_utf8 | ( | ble_srv_utf8_str_t * | p_utf8, |
char * | p_ascii | ||
) |
Function for making a UTF-8 structure refer to an ASCII string.
- Parameters:
-
[out] p_utf8 UTF-8 structure to be set. [in] p_ascii ASCII string to be referred to.
Definition at line 57 of file ble_srv_common.c.
static __INLINE bool ble_srv_is_indication_enabled | ( | uint8_t * | p_encoded_data ) | [static] |
Function for decoding a CCCD value, and then testing if indication is enabled.
- Parameters:
-
[in] p_encoded_data Buffer where the encoded CCCD is stored.
- Return values:
-
TRUE If indication is enabled. FALSE Otherwise.
Definition at line 238 of file ble_srv_common.h.
static __INLINE bool ble_srv_is_notification_enabled | ( | uint8_t * | p_encoded_data ) | [static] |
Function for decoding a CCCD value, and then testing if notification is enabled.
- Parameters:
-
[in] p_encoded_data Buffer where the encoded CCCD is stored.
- Return values:
-
TRUE If notification is enabled. FALSE Otherwise.
Definition at line 224 of file ble_srv_common.h.
uint8_t ble_srv_report_ref_encode | ( | uint8_t * | p_encoded_buffer, |
const ble_srv_report_ref_t * | p_report_ref | ||
) |
Function for encoding a Report Reference Descriptor.
- Parameters:
-
[in] p_encoded_buffer The buffer of the encoded data. [in] p_report_ref Report Reference value to be encoded.
- Returns:
- Length of the encoded data.
Definition at line 44 of file ble_srv_common.c.
uint32_t characteristic_add | ( | uint16_t | service_handle, |
ble_add_char_params_t * | p_char_props, | ||
ble_gatts_char_handles_t * | p_char_handle | ||
) |
Function for adding a characteristic to a given service.
If no pointer is given for the initial value, the initial length parameter will be ignored and the initial length will be 0.
- Parameters:
-
[in] service_handle Handle of the service to which the characteristic is to be added. [in] p_char_props Information needed to add the characteristic. [out] p_char_handle Handle of the added characteristic.
- Return values:
-
NRF_SUCCESS If the characteristic was added successfully. Otherwise, an error code is returned.
Definition at line 101 of file ble_srv_common.c.
uint32_t descriptor_add | ( | uint16_t | char_handle, |
ble_add_descr_params_t * | p_descr_props, | ||
uint16_t * | p_descr_handle | ||
) |
Function for adding a characteristic's descriptor to a given characteristic.
- Parameters:
-
[in] char_handle Handle of the characteristic to which the descriptor is to be added, if BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. [in] p_descr_props Information needed to add the descriptor. [out] p_descr_handle Handle of the added descriptor.
- Return values:
-
NRF_SUCCESS If the characteristic was added successfully. Otherwise, an error code is returned.
Definition at line 182 of file ble_srv_common.c.
Generated on Tue Jul 12 2022 15:51:31 by 1.7.2