ble_prf_utils.h
Go to the documentation of this file.
1
51 #ifndef __BLE_PRF_UTILS_H__
52 #define __BLE_PRF_UTILS_H__
53
54 #include "ble_prf_types.h"
55 #include <stdbool.h>
56
70 void prf_pack_char_pres_fmt(uint8_t *p_packed_val, const prf_char_pres_fmt_t *p_char_pres_fmt);
71
82 void prf_unpack_char_pres_fmt(const uint8_t *p_packed_val, prf_char_pres_fmt_t *p_char_pres_fmt);
83
94 uint8_t prf_pack_date_time(uint8_t *p_packed_val, const prf_date_time_t *p_date_time);
95
106 uint8_t prf_unpack_date_time(const uint8_t *p_packed_val, prf_date_time_t *p_date_time);
107
121 uint8_t prf_find_idx_by_handle(uint16_t handle, uint16_t start_hdl,
122 uint8_t char_nb, uint8_t *p_char_mask);
123
136 uint16_t prf_find_handle_by_idx(uint8_t idx, uint16_t start_hdl, uint8_t *p_char_mask);
137
147 bool prf_is_cccd_value_valid(uint16_t cccd_value);
148
158 bool prf_is_notification_enabled(uint16_t cccd_value);
159
169 bool prf_is_indication_enabled(uint16_t cccd_value);
172 #endif /* _BLE_PRF_UTILS_H_ */
173
prf_pack_char_pres_fmt
void prf_pack_char_pres_fmt(uint8_t *p_packed_val, const prf_char_pres_fmt_t *p_char_pres_fmt)
Pack Characteristic Presentation Format descriptor value to a buffer.
prf_is_notification_enabled
bool prf_is_notification_enabled(uint16_t cccd_value)
Check if a CCCD value is notification enabled.
prf_char_pres_fmt_t
Characteristic Presentation Format Descriptor structure. The packed size is PRF_CHAR_PRES_FMT_SIZE.
Definition: ble_prf_types.h:91
prf_unpack_char_pres_fmt
void prf_unpack_char_pres_fmt(const uint8_t *p_packed_val, prf_char_pres_fmt_t *p_char_pres_fmt)
Unpack the data in a buffer to the structure of Characteristic Presentation Format descriptor value.
ble_prf_types.h
Profile/Service Common Types.
prf_pack_date_time
uint8_t prf_pack_date_time(uint8_t *p_packed_val, const prf_date_time_t *p_date_time)
Pack the value in date-time structure to a buffer.
prf_date_time_t
The date and time structure. The packed size is 7 bytes.
Definition: ble_prf_types.h:101
prf_unpack_date_time
uint8_t prf_unpack_date_time(const uint8_t *p_packed_val, prf_date_time_t *p_date_time)
Unpack the data in buffer to the date-time structure.
prf_is_indication_enabled
bool prf_is_indication_enabled(uint16_t cccd_value)
Check if a CCCD value is indication enabled.
prf_find_idx_by_handle
uint8_t prf_find_idx_by_handle(uint16_t handle, uint16_t start_hdl, uint8_t char_nb, uint8_t *p_char_mask)
Find the attribute index by handle.
prf_find_handle_by_idx
uint16_t prf_find_handle_by_idx(uint8_t idx, uint16_t start_hdl, uint8_t *p_char_mask)
Find the attribute handle by index.
prf_is_cccd_value_valid
bool prf_is_cccd_value_valid(uint16_t cccd_value)
Check if a CCCD value is valid.