Bluetooth Low Energy Stack Abstraction Function Documentation
GAP_Initialize
void GAP_Initialize()
Location: ble_gap.h:167
GAP_GetEnv
const GAP_Env_t * GAP_GetEnv()
Location: ble_gap.h:176
Return
GAP_GetProfileAddedTaskId
uint16_t * GAP_GetProfileAddedTaskId()
Location: ble_gap.h:183
Return
GAP_IsAddrPrivateResolvable
bool GAP_IsAddrPrivateResolvable(const uint8_t * addr, uint8_t addrType)
Location: ble_gap.h:192
Parameters
Direction | Name | Description |
---|---|---|
in |
addr |
Pointer to address |
in |
addrType |
Type of address |
Return
GAP_AddAdvData
bool GAP_AddAdvData(bool isExtendedAdv, uint8_t newDataLen, enum gap_ad_type newDataFlag, const uint8_t * newData, uint8_t * resultAdvData, uint8_t * resultAdvDataLen)
Location: ble_gap.h:207
Parameters
Direction | Name | Description |
---|---|---|
in |
isExtendedAdv |
If extended advertising is required |
in |
newDataLen |
Advertisement data length to add |
in |
newDataFlag |
Type of advertisement data |
in |
newData |
Pointer to new advertisement data to add |
in |
resultAdvData |
Pointer to resultant advertisement data buffer |
in |
resultAdvDataLen |
Length of resultant advertisement data |
Return
GAPM_ResetCmd
void GAPM_ResetCmd(enum gapm_operation operation)
Location: ble_gap.h:216
Parameters
Direction | Name | Description |
---|---|---|
in |
operation |
GAPM operation code |
GAPM_SoftwareReset
void GAPM_SoftwareReset()
Location: ble_gap.h:223
GAPM_PlatformReset
void GAPM_PlatformReset()
Location: ble_gap.h:230
GAPM_SetDevConfigCmd
void GAPM_SetDevConfigCmd(const struct gapm_set_dev_config_cmd * deviceConfig)
Location: ble_gap.h:244
Parameters
Direction | Name | Description |
---|---|---|
in |
deviceConfig |
Pointer to constant GAPM set device configuration command |
NOTE: : This command is allowed only when no link is established
GAPM_GetDeviceConfig
const struct gapm_set_dev_config_cmd * GAPM_GetDeviceConfig()
Location: ble_gap.h:256
Return
GAPM_ProfileTaskAddCmd
void GAPM_ProfileTaskAddCmd(uint8_t sec_lvl, uint16_t prf_task_id, uint16_t app_task, uint16_t start_hdl, uint8_t * param, uint32_t paramSize)
Location: ble_gap.h:271
Parameters
Direction | Name | Description |
---|---|---|
in |
sec_lvl |
Security level |
in |
prf_task_id |
Profile task identifier of profile to add |
in |
app_task |
Application task number |
in |
start_hdl |
Service start handle (0 for dynamically allocated in attribute database) |
in |
param |
Pointer to parameter value to initialize profile |
in |
paramSize |
Size of parameter |
GAPM_GetProfileAddedCount
uint16_t GAPM_GetProfileAddedCount()
Location: ble_gap.h:281
Return
GAPM_LepsmRegisterCmd
void GAPM_LepsmRegisterCmd(uint16_t le_psm, uint16_t app_task, uint8_t sec_lvl)
Location: ble_gap.h:293
Parameters
Direction | Name | Description |
---|---|---|
in |
le_psm |
LE protocol/service multiplexer |
in |
app_task |
Application task number |
in |
sec_lvl |
Security level |
GAPM_GenRandAddrCmd
void GAPM_GenRandAddrCmd(enum random_addr_type rnd_type)
Location: ble_gap.h:303
Parameters
Direction | Name | Description |
---|---|---|
in |
rnd_type |
Random address type |
GAPM_ResolvAddrCmd
void GAPM_ResolvAddrCmd(uint8_t conidx, const uint8_t * peerAddr)
Location: ble_gap.h:314
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
peerAddr |
Resolvable random address to solve |
GAPM_ActivityCreateAdvCmd
bool GAPM_ActivityCreateAdvCmd(GAPM_ActivityStatus_t * actv_status, enum gapm_own_addr own_addr_type, const struct gapm_adv_create_param * adv_param)
Location: ble_gap.h:327
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_status |
Pointer to GAPM activity status |
in |
own_addr_type |
Bluetooth device`s own address type |
in |
adv_param |
Pointer to constant advertising parameters structure |
Return
GAPM_ActivityCreateScanCmd
bool GAPM_ActivityCreateScanCmd(GAPM_ActivityStatus_t * actv_status, enum gapm_own_addr own_addr_type)
Location: ble_gap.h:341
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_status |
Pointer to GAPM activity status |
in |
own_addr_type |
Bluetooth device`s own address type |
Return
GAPM_ActivityCreateInitCmd
bool GAPM_ActivityCreateInitCmd(GAPM_ActivityStatus_t * actv_status, enum gapm_own_addr own_addr_type)
Location: ble_gap.h:354
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_status |
Pointer to GAPM activity status |
in |
own_addr_type |
Bluetooth device`s own address type |
Return
GAPM_ActivityCreatePeriodSyncCmd
bool GAPM_ActivityCreatePeriodSyncCmd(GAPM_ActivityStatus_t * actv_status, enum gapm_own_addr own_addr_type)
Location: ble_gap.h:367
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_status |
Pointer to GAPM activity status |
in |
own_addr_type |
Bluetooth device`s own address type |
Return
GAPM_AdvActivityStart
bool GAPM_AdvActivityStart(uint8_t actv_idx, uint16_t duration, uint8_t max_adv_evt)
Location: ble_gap.h:383
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_idx |
Activity identifier |
in |
duration |
Advertising duration (in unit of 10ms). 0 means that advertising continues until the host disables it. |
in |
max_adv_evt |
Maximum number of extended advertising events the controller shall attempt to send prior to terminating the extended advertising |
Return
GAPM_InitActivityStart
bool GAPM_InitActivityStart(uint8_t actv_idx, struct gapm_init_param * initParam)
Location: ble_gap.h:395
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_idx |
Activity identifier |
in |
initParam |
Pointer to initiating parameters structure |
Return
GAPM_ScanActivityStart
bool GAPM_ScanActivityStart(uint8_t actv_idx, struct gapm_scan_param * scanParam)
Location: ble_gap.h:407
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_idx |
Activity identifier |
in |
scanParam |
Pointer to scan parameters structure |
Return
GAPM_PerSyncActivityStart
bool GAPM_PerSyncActivityStart(uint8_t actv_idx, struct gapm_per_sync_param * per_sync_param)
Location: ble_gap.h:419
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_idx |
Activity identifier |
in |
per_sync_param |
Pointer to periodic sync parameters structure |
Return
GAPM_ActivityStartCmd
bool GAPM_ActivityStartCmd(uint8_t actv_idx, union gapm_u_param * u_param)
Location: ble_gap.h:431
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_idx |
Activity identifier |
in |
u_param |
Pointer to union to containing activity parameters |
Return
GAPM_ActivityStop
bool GAPM_ActivityStop(uint8_t actv_idx)
Location: ble_gap.h:442
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_idx |
Activity identifier |
Return
GAPM_ActivityStopAll
bool GAPM_ActivityStopAll()
Location: ble_gap.h:452
Return
GAPM_DeleteActivity
bool GAPM_DeleteActivity(uint8_t actv_idx)
Location: ble_gap.h:463
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_idx |
Activity identifier (used only if operation is GAPM_DELETE_ACTIVITY) |
Return
GAPM_DeleteAllActivities
bool GAPM_DeleteAllActivities()
Location: ble_gap.h:473
Return
GAPM_ActivityStopCmd
bool GAPM_ActivityStopCmd(uint8_t operation, uint8_t actv_idx)
Location: ble_gap.h:485
Parameters
Direction | Name | Description |
---|---|---|
in |
operation |
GAPM operation code [GAPM_STOP_ACTIVITY or GAPM_STOP_ALL_ACTIVITIES] |
in |
actv_idx |
Activity identifier (used only if operation is GAPM_STOP_ACTIVITY) |
Return
GAPM_DeleteActivityCmd
bool GAPM_DeleteActivityCmd(uint8_t operation, uint8_t actv_idx)
Location: ble_gap.h:497
Parameters
Direction | Name | Description |
---|---|---|
in |
operation |
GAPM operation code [GAPM_DELETE_ACTIVITY or GAPM_DELETE_ALL_ACTIVITIES] |
in |
actv_idx |
Activity identifier (used only if operation is GAPM_DELETE_ACTIVITY) |
Return
GAPM_SetAdvDataCmd
bool GAPM_SetAdvDataCmd(uint8_t operation, uint8_t actv_idx, uint8_t length, uint8_t * data)
Location: ble_gap.h:514
Parameters
Direction | Name | Description |
---|---|---|
in |
operation |
GAPM operation code (GAPM_SET_ADV_DATA or GAPM_SET_SCAN_RSP_DATA or GAPM_SET_PERIOD_ADV_DATA) |
in |
actv_idx |
Activity identifier |
in |
length |
Length of data |
in |
data |
Pointer to data |
Return
GAPM_MsgHandler
void GAPM_MsgHandler(ke_msg_id_t const msg_id, void const * param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
Location: ble_gap.h:527
Parameters
Direction | Name | Description |
---|---|---|
in |
msg_id |
Kernel message identifier |
in |
param |
Pointer to constant parameter |
in |
dest_id |
Constant destination kernel identifier |
in |
src_id |
Constant source kernel identifier |
GAPC_ParamUpdateCmd
void GAPC_ParamUpdateCmd(uint8_t conidx, uint16_t intv_min, uint16_t intv_max, uint16_t latency, uint16_t time_out, uint16_t ce_len_min, uint16_t ce_len_max)
Location: ble_gap.h:543
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
intv_min |
Minimum of connection interval (value = intv_max * 1.25 ms) |
in |
intv_max |
Maximum of connection interval (value = intv_max * 1.25 ms) |
in |
latency |
connection latency |
in |
time_out |
Link supervision timeout (value = time_out * 10 ms) |
in |
ce_len_min |
Minimum CE length (value = ce_len_min * 0.625 ms) |
in |
ce_len_max |
Maximum CE length (value = ce_len_min * 0.625 ms) |
GAPC_ParamUpdateCfm
void GAPC_ParamUpdateCfm(uint8_t conidx, bool accept, uint16_t ce_len_min, uint16_t ce_len_max)
Location: ble_gap.h:557
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
accept |
Accept(0x01) or reject(0x00) slave connection parameters |
in |
ce_len_min |
Minimum CE length (value = ce_len_min * 0.625 ms) |
in |
ce_len_max |
Maximum CE length (value = ce_len_min * 0.625 ms) |
GAPC_ConnectionCfm
void GAPC_ConnectionCfm(uint8_t conidx, struct gapc_connection_cfm * param)
Location: ble_gap.h:569
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
param |
Pointer to GAPC connection confirmation structure |
GAPC_DisconnectCmd
void GAPC_DisconnectCmd(uint8_t conidx, uint8_t reason)
Location: ble_gap.h:580
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
reason |
Reason for disconnection |
GAPC_IsConnectionActive
bool GAPC_IsConnectionActive(uint8_t conidx)
Location: ble_gap.h:591
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
Return
GAPC_DisconnectAll
void GAPC_DisconnectAll(uint8_t reason)
Location: ble_gap.h:601
Parameters
Direction | Name | Description |
---|---|---|
in |
reason |
Reason for disconnection |
GAPC_ConnectionCount
uint8_t GAPC_ConnectionCount()
Location: ble_gap.h:608
Return
GAPC_MasterConnectionCount
uint8_t GAPC_MasterConnectionCount()
Location: ble_gap.h:615
Return
GAPC_SlaveConnectionCount
uint8_t GAPC_SlaveConnectionCount()
Location: ble_gap.h:622
Return
GAPC_GetConnectionInfo
const struct gapc_connection_req_ind * GAPC_GetConnectionInfo(uint8_t conidx)
Location: ble_gap.h:632
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
Return
GAPC_GetDevInfoCfm_Name
void GAPC_GetDevInfoCfm_Name(uint8_t conidx, const char * devName)
Location: ble_gap.h:643
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
devName |
Pointer to device name |
GAPC_GetDevInfoCfm_Appearance
void GAPC_GetDevInfoCfm_Appearance(uint8_t conidx, uint16_t appearance)
Location: ble_gap.h:654
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
appearance |
Appearance icon |
GAPC_GetDevInfoCfm_SlvPrefParams
void GAPC_GetDevInfoCfm_SlvPrefParams(uint8_t conidx, uint16_t con_intv_min, uint16_t con_intv_max, uint16_t slave_latency, uint16_t conn_timeout)
Location: ble_gap.h:668
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
con_intv_min |
Minimum connection interval (value = con_intv_min * 1.25 ms) |
in |
con_intv_max |
Maximum connection interval (value = con_intv_max * 1.25 ms) |
in |
slave_latency |
Slave latency |
in |
conn_timeout |
Connection supervision timeout (value = conn_timeout * 10 ms) |
GAPC_GetDevInfoCfm
void GAPC_GetDevInfoCfm(uint8_t conidx, uint8_t req, const union gapc_dev_info_val * dat)
Location: ble_gap.h:682
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
req |
Requested information |
in |
dat |
Pointer to constant union GAPC device information value |
GAPC_SetDevInfoCfm
bool GAPC_SetDevInfoCfm(uint8_t conidx, uint8_t req, bool accept)
Location: ble_gap.h:697
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
req |
Requested information (GAPC_DEV_NAME or GAPC_DEV_APPEARANCE) |
in |
accept |
True if the write request has been approved, false otherwise |
Return
GAPC_BondCfm
void GAPC_BondCfm(uint8_t conidx, enum gapc_bond request, bool accept, const union gapc_bond_cfm_data * data)
Location: ble_gap.h:714
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
request |
Bond request type |
in |
accept |
Accept(0x01) or reject(0x00) request |
in |
data |
Pointer to constant GAPC bond confirmation data union |
GAPC_EncryptCmd
void GAPC_EncryptCmd(uint8_t conidx, uint16_t ediv, const uint8_t * randnb, const uint8_t * ltk, uint8_t key_size)
Location: ble_gap.h:729
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
ediv |
Encryption diversifier |
in |
randnb |
Pointer to constant random number |
in |
ltk |
Pointer to constant long term key |
in |
key_size |
Size of LTK key |
GAPC_EncryptCfm
void GAPC_EncryptCfm(uint8_t conidx, bool found, const uint8_t * ltk, uint8_t key_size)
Location: ble_gap.h:743
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
found |
Nonzero if LTK is found for peer device, zero otherwise |
in |
ltk |
Pointer to constant long term key |
in |
key_size |
Size of LTK key |
GAPC_IsBonded
bool GAPC_IsBonded(uint8_t conidx)
Location: ble_gap.h:753
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
Return
GAPC_GetBondInfo
const BondInfo_t * GAPC_GetBondInfo(uint8_t conidx)
Location: ble_gap.h:764
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
Return
GAPC_BondCmd
void GAPC_BondCmd(uint8_t conidx, const struct gapc_pairing * pairing)
Location: ble_gap.h:775
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
pairing |
Pointer to constant structure pairing information |
GAPC_AddRecordToBondList
uint16_t GAPC_AddRecordToBondList(uint8_t conidx)
Location: ble_gap.h:785
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
Return
GAPC_MsgHandler
void GAPC_MsgHandler(ke_msg_id_t const msg_id, void const * param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
Location: ble_gap.h:797
Parameters
Direction | Name | Description |
---|---|---|
in |
msg_id |
Kernel message identifier |
in |
param |
Pointer to constant parameter |
in |
dest_id |
Constant destination kernel identifier |
in |
src_id |
Constant source kernel identifier |
GAPM_ListSetWlCmd
void GAPM_ListSetWlCmd(uint8_t operation, uint8_t nb, struct gap_bdaddr * devices_wl)
Location: ble_gap.h:810
Parameters
Direction | Name | Description |
---|---|---|
in |
operation |
GAPM operation code to set the content of white list |
in |
nb |
Number of entries to be added in the list |
in |
devices_wl |
Pointer to structure containing list of addresses to be added in the white list |
GAPM_ListSetRalCmd
void GAPM_ListSetRalCmd(uint8_t operation, uint8_t nb, struct gap_ral_dev_info * rl_devinfo)
Location: ble_gap.h:823
Parameters
Direction | Name | Description |
---|---|---|
in |
operation |
GAPM operation code to set the content of white list |
in |
nb |
Number of entries to be added in the list |
in |
rl_devinfo |
Pointer to structure containing list of addresses to be added in the resolving list |
GAPM_IsIRKValid
bool GAPM_IsIRKValid(const BondInfo_t * bond_info)
Location: ble_gap.h:834
Parameters
Direction | Name | Description |
---|---|---|
in |
bond_info |
Pointer to constant bond information |
Return
WhiteList_ResolvableList_Update
bool WhiteList_ResolvableList_Update()
Location: ble_gap.h:842
GAPM_GetWhitelistNumDev
uint16_t GAPM_GetWhitelistNumDev()
Location: ble_gap.h:851
Return
GAPM_SetWhitelistNumDev
void GAPM_SetWhitelistNumDev()
Location: ble_gap.h:860
Return
GAPC_SetPhyCmd
void GAPC_SetPhyCmd(uint8_t conidx, uint8_t rx_rate, uint8_t tx_rate, uint8_t preferredRate)
Location: ble_gap.h:877
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
rx_rate |
Preferred LE PHYs for reception |
in |
tx_rate |
Preferred LE PHYs for transmission |
in |
preferredRate |
Preferred coding scheme for LE coded |
GAPC_CteTxCfgCmd
void GAPC_CteTxCfgCmd(uint8_t conidx, uint8_t cte_type, uint8_t ant_pattern_len, uint8_t * ant_id)
Location: ble_gap.h:895
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
cte_type |
CTE types |
in |
ant_pattern_len |
Length of switching pattern |
in |
ant_id |
Pointer to antenna IDs |
GAPC_CteRxCfgCmd
void GAPC_CteRxCfgCmd(uint8_t conidx, uint8_t slot_dur, uint8_t ant_pattern_len, uint8_t * ant_id, bool sample_en)
Location: ble_gap.h:910
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
slot_dur |
Slot durations (1: 1us, 2: 2us) |
in |
ant_pattern_len |
Length of switching pattern |
in |
ant_id |
Pointer to antenna IDs |
in |
sample_en |
Enable or disable sampling |
GAPC_CteReqCtrlCmd
void GAPC_CteReqCtrlCmd(uint8_t conidx, uint8_t cte_type, uint8_t cte_len, uint8_t cte_interval, bool enable)
Location: ble_gap.h:925
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
cte_type |
CTE types |
in |
cte_len |
Request CTE length (in 8us unit) |
in |
cte_interval |
CTE request interval (in no of connection events) |
in |
enable |
Enable or disable TX/RX CTE |
GAPC_CteRspCtrlCmd
void GAPC_CteRspCtrlCmd(uint8_t conidx, bool enable)
Location: ble_gap.h:937
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
enable |
Enable or disable TX/RX CTE |
GAPC_GetInfoCmd
void GAPC_GetInfoCmd(uint8_t conidx, uint8_t operation)
Location: ble_gap.h:952
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection identifier |
in |
operation |
GAPC requested operation |
GAPM_PerAdvCteTxCmd
bool GAPM_PerAdvCteTxCmd(uint8_t actv_idx, bool enable)
Location: ble_gap.h:962
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_idx |
Activity identifier |
in |
enable |
Enable or disable CTE transmission |
Return
GAPM_PerAdvReportCtrlCmd
bool GAPM_PerAdvReportCtrlCmd(uint8_t actv_idx, bool enable)
Location: ble_gap.h:972
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_idx |
Activity identifier |
in |
enable |
Enable or disable reception of periodic advertising report |
Return
GAPM_PerSyncIQSamplingCtrlCmd
bool GAPM_PerSyncIQSamplingCtrlCmd(uint8_t actv_idx, uint8_t slot_dur, uint8_t max_sample_cte, uint8_t ant_pattern_len, uint8_t * ant_id, bool enable)
Location: ble_gap.h:987
Parameters
Direction | Name | Description |
---|---|---|
in |
actv_idx |
Activity identifier |
in |
slot_dur |
Slot durations (1: 1us | 2: 2us) |
in |
max_sample_cte |
Maximum sampled CTEs |
in |
ant_pattern_len |
Length of switching pattern |
in |
ant_id |
Pointer to antenna IDs |
in |
enable |
Enable IQ sampling |
Return
GATT_Initialize
void GATT_Initialize()
Location: ble_gatt.h:198
GATT_GetEnv
const GATT_Env_t * GATT_GetEnv()
Location: ble_gatt.h:207
GATT_SetEnvData
void GATT_SetEnvData(uint16_t * disc_svc_count, cust_svc_desc * custom_service_db, uint8_t max_cust_svc_num)
Location: ble_gatt.h:219
Parameters
Direction | Name | Description |
---|---|---|
in |
disc_svc_count |
Pointer to discovered services count |
in |
custom_service_db |
Pointer to custom service database |
in |
max_cust_svc_num |
Maximum number of custom services |
GATT_GetMaxCustomServiceNumber
uint16_t GATT_GetMaxCustomServiceNumber()
Location: ble_gatt.h:229
Return
GATTM_GetServiceAddedCount
uint16_t GATTM_GetServiceAddedCount()
Location: ble_gatt.h:238
Return
GATTM_ResetServiceAttributeDatabaseID
void GATTM_ResetServiceAttributeDatabaseID()
Location: ble_gatt.h:247
GATTM_AddAttributeDatabase
void GATTM_AddAttributeDatabase(const struct att_db_desc * att_db, uint16_t att_db_len)
Location: ble_gatt.h:259
Parameters
Direction | Name | Description |
---|---|---|
in |
att_db |
Pointer to constant custom service attribute database |
in |
att_db_len |
Number of elements in the att_db array |
NOTE: Triggers a GATTM_ADD_SVC_RSP for every service added.
GATTM_GetHandle
uint16_t GATTM_GetHandle(uint8_t cs_svc_number, uint16_t attidx)
Location: ble_gatt.h:274
Parameters
Direction | Name | Description |
---|---|---|
in |
cs_svc_number |
Custom service number related to attribute |
in |
attidx |
Attribute index |
Return
NOTE: The user has used GATT_AddAttributeDatabase() to construct the database and the stack has already finished adding services to the database.
GATTM_MsgHandler
void GATTM_MsgHandler(ke_msg_id_t const msg_id, void const * param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
Location: ble_gatt.h:286
Parameters
Direction | Name | Description |
---|---|---|
in |
msg_id |
Kernel message identifier |
in |
param |
Pointer to constant message parameter (unused) |
in |
dest_id |
Destination task identifier |
in |
src_id |
Source task identifier |
GATTC_Initialize
void GATTC_Initialize()
Location: ble_gatt.h:294
GATTC_DiscByUUIDSvc
void GATTC_DiscByUUIDSvc(uint8_t conidx, uint8_t uuid, uint8_t uuid_len, uint16_t start_hdl, uint16_t end_hdl)
Location: ble_gatt.h:308
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection index |
|
uuid |
|
in |
uuid_len |
UUID length (ATT_UUID_16_LEN or ATT_UUID_32_LEN or ATT_UUID_128_LEN) |
in |
start_hdl |
Start handle of a discovery range |
in |
end_hdl |
End handle of a discovery range |
GATTC_DiscAllSvc
void GATTC_DiscAllSvc(uint8_t conidx, uint16_t start_hdl, uint16_t end_hdl)
Location: ble_gatt.h:320
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection index |
in |
start_hdl |
Start handle of discovery range |
in |
end_hdl |
End handle of discovery range |
GATTC_DiscAllChar
void GATTC_DiscAllChar(uint8_t conidx, uint16_t start_hdl, uint16_t end_hdl)
Location: ble_gatt.h:332
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection index |
in |
start_hdl |
Start handle of discovery range |
in |
end_hdl |
End handle of discovery range |
GATTC_SendEvtCmd
void GATTC_SendEvtCmd(uint8_t conidx, uint8_t operation, uint16_t seq_num, uint16_t handle, uint16_t length, uint8_t * value)
Location: ble_gatt.h:346
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection index |
in |
operation |
GATTC_NOTIFY or GATTC_INDICATE |
in |
seq_num |
Operation sequence number |
in |
handle |
Characteristic handle |
in |
length |
Attribute length |
in |
value |
Pointer to attribute data value |
GATTC_SendEvtCfm
void GATTC_SendEvtCfm(uint8_t conidx, uint16_t handle)
Location: ble_gatt.h:357
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection index |
in |
handle |
Characteristic handle |
GATTC_MtuExchange
void GATTC_MtuExchange(uint8_t conidx)
Location: ble_gatt.h:366
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection index |
GATTC_ReadReqInd
void GATTC_ReadReqInd(ke_msg_id_t const msg_id, struct gattc_read_req_ind const * param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
Location: ble_gatt.h:380
Parameters
Direction | Name | Description |
---|---|---|
in |
msg_id |
Kernel message identifier |
in |
param |
Pointer to constant message parameters (in format of structure gattc_read_req_ind) |
in |
dest_id |
Destination task identifier |
in |
src_id |
Source task identifier |
NOTE: Indicate if the message was consumed, compare with KE_MSG_CONSUMED
GATTC_WriteReqInd
void GATTC_WriteReqInd(ke_msg_id_t const msg_id, struct gattc_write_req_ind const * param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
Location: ble_gatt.h:396
Parameters
Direction | Name | Description |
---|---|---|
in |
msg_id |
Kernel message identifier |
in |
param |
Pointer to constant message parameters (in format of structure gattc_write_req_ind) |
in |
dest_id |
Destination task identifier |
in |
src_id |
Source task identifier |
NOTE: Indicate if the message was consumed, compare with KE_MSG_CONSUMED
GATTC_AttInfoReqInd
void GATTC_AttInfoReqInd(ke_msg_id_t const msg_id, struct gattc_read_req_ind const * param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
Location: ble_gatt.h:415
Parameters
Direction | Name | Description |
---|---|---|
in |
msg_id |
Kernel message identifier |
in |
param |
Pointer to constant message parameters (in format of structure gattc_read_req_ind) |
in |
dest_id |
Destination task identifier |
in |
src_id |
Source task identifier |
NOTE: Indicate if the message was consumed, compare with KE_MSG_CONSUMED
GATTC_MsgHandler
void GATTC_MsgHandler(ke_msg_id_t const msg_id, void const * param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
Location: ble_gatt.h:430
Parameters
Direction | Name | Description |
---|---|---|
in |
msg_id |
Kernel message identifier |
in |
param |
Pointer to constant message parameter (unused) |
in |
dest_id |
Destination task identifier |
in |
src_id |
Source task identifier |
NOTE: Indicate if the message was consumed, compare with KE_MSG_CONSUMED
Device_BLE_Public_Address_Read
void Device_BLE_Public_Address_Read(uint32_t ble_addr_location)
Location: ble_protocol_support.h:77
Parameters
Direction | Name | Description |
---|---|---|
in |
ble_addr_location |
Location to read value from |
Device_BLE_Param_Get
uint8_t Device_BLE_Param_Get(uint8_t param_id, uint8_t * lengthPtr, uint8_t * buf)
Location: ble_protocol_support.h:90
Parameters
Direction | Name | Description |
---|---|---|
in |
param_id |
Parameter identifier |
in |
lengthPtr |
Pointer to the length of parameter |
in |
buf |
Pointer to returned value |
Return
rand_func
int rand_func()
Location: ble_protocol_support.h:97
Return
set_app_rand_func
void set_app_rand_func(int(*)(void) func)
Location: ble_protocol_support.h:105
Parameters
Direction | Name | Description |
---|---|---|
in |
func |
Function containing random number generator |
srand_func
void srand_func(uint32_t seed)
Location: ble_protocol_support.h:112
Parameters
Direction | Name | Description |
---|---|---|
in |
seed |
Seed value |
set_app_rand_seed_val
void set_app_rand_seed_val(uint32_t seed)
Location: ble_protocol_support.h:119
Parameters
Direction | Name | Description |
---|---|---|
in |
seed |
Seed value |
default_rf_rssi_func
int8_t default_rf_rssi_func(uint8_t rssi_reg)
Location: ble_protocol_support.h:129
Parameters
Direction | Name | Description |
---|---|---|
in |
rssi_reg |
RF data value |
set_app_rf_rssi_func
void set_app_rf_rssi_func(int8_t(*)(uint8_t) func)
Location: ble_protocol_support.h:137
Parameters
Direction | Name | Description |
---|---|---|
in |
func |
Function containing RF to RSSI calculations |
MsgHandler_GetTaskAppDesc
const struct ke_task_desc * MsgHandler_GetTaskAppDesc()
Location: msg_handler.h:42
Return
MsgHandler_Add
bool MsgHandler_Add(ke_msg_id_t const msg_id, MsgHandlerCallback_t callback)
Location: msg_handler.h:58
Parameters
Direction | Name | Description |
---|---|---|
in |
msg_id |
A message identifier (such as GAPM_CMP_EVT) or a task identifier (such as TASK_ID_GAPM) |
in |
callback |
A pointer to the callback function that should be called when an event matching msg_id happens |
Return
If the msg_id argument is a task identifier (such as TASK_ID_GAPM), the callback function is for for any event triggered from that task
MsgHandler_Notify
int MsgHandler_Notify(ke_msg_id_t const msg_id, void const * param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
Location: msg_handler.h:80
Parameters
Direction | Name | Description |
---|---|---|
in |
msg_id |
A message identifier (such as GAPM_CMP_EVT) or a task identifier (such as TASK_ID_GAPM) |
in |
param |
Message parameter |
in |
dest_id |
Destination task identifier |
in |
src_id |
Source task identifier |
Return
It also makes sure to call the BLE abstraction message handlers prior to any application message handler
NOTE: This function was designed to be used as the default handler of the kernel and shall NOT be called directly by the application. To notify an event, the application should instead enqueue a message in the kernel, in order to avoid chaining the context of function calls and causing a stack overflow
BASC_Initialize
void BASC_Initialize()
Location: ble_basc.h:81
BASC_EnableReq
void BASC_EnableReq(uint8_t conidx)
Location: ble_basc.h:92
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection index |
NOTE: conidx is valid (between 0 and GAP_MAX_CONNECTIONS-1)
BASC_ReadInfoReq
void BASC_ReadInfoReq(uint8_t conidx, uint8_t bas_nb, uint8_t info)
Location: ble_basc.h:104
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection index |
in |
bas_nb |
Battery instance number |
in |
info |
Peer battery info type |
BASC_BattLevelNtfCfgReq
void BASC_BattLevelNtfCfgReq(uint8_t conidx, uint8_t bas_nb, uint8_t ntf_cfg)
Location: ble_basc.h:116
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection index |
in |
bas_nb |
Battery instance number |
in |
ntf_cfg |
The value of notification configuration |
BASC_RequestBattLevelOnTimeout
void BASC_RequestBattLevelOnTimeout(uint32_t timeout_ms)
Location: ble_basc.h:126
Parameters
Direction | Name | Description |
---|---|---|
in |
timeout_ms |
Delay between requests in units of 10ms. If timeout == 0, disable periodic requests. |
BASC_GetLastBatteryLevel
uint8_t BASC_GetLastBatteryLevel(uint8_t conidx, uint8_t bas_nb)
Location: ble_basc.h:137
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection index |
in |
bas_nb |
Battery instance number |
Return
BASC_GetEnv
const BASC_Env_t * BASC_GetEnv()
Location: ble_basc.h:146
BASC_MsgHandler
void BASC_MsgHandler(ke_msg_id_t const msg_id, void const * param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
Location: ble_basc.h:158
Parameters
Direction | Name | Description |
---|---|---|
in |
msg_id |
Kernel message identifier |
in |
param |
Pointer to constant message parameter |
in |
dest_id |
Destination task identifier |
in |
src_id |
Source task identifier |
BASS_Initialize
void BASS_Initialize(uint8_t bas_nb, uint8_t(*)(uint8_t bas_nb) readBattLevelCallback)
Location: ble_bass.h:82
Parameters
Direction | Name | Description |
---|---|---|
in |
bas_nb |
Number of battery instances [1,2]. |
in |
readBattLevelCallback |
Pointer to user application callback function that returns the battery value. |
BASS_NotifyOnTimeout
void BASS_NotifyOnTimeout(uint32_t timeout)
Location: ble_bass.h:93
Parameters
Direction | Name | Description |
---|---|---|
in |
timeout |
Timeout period in units of 10ms. disabled if timeout == 0 |
BASS_NotifyOnBattLevelChange
void BASS_NotifyOnBattLevelChange(uint32_t timeout)
Location: ble_bass.h:107
Parameters
Direction | Name | Description |
---|---|---|
in |
timeout |
Timeout period in units of 10ms. disabled if timeout == 0 |
BASS_ProfileTaskAddCmd
void BASS_ProfileTaskAddCmd()
Location: ble_bass.h:114
BASS_EnableReq
void BASS_EnableReq(uint8_t conidx)
Location: ble_bass.h:124
Parameters
Direction | Name | Description |
---|---|---|
in |
conidx |
Connection index |
BASS_BattLevelUpdReq
void BASS_BattLevelUpdReq(uint8_t batt_lvl, uint8_t bas_nb)
Location: ble_bass.h:137
Parameters
Direction | Name | Description |
---|---|---|
in |
batt_lvl |
Battery level [0, 100] |
in |
bas_nb |
Battery server instance number |
BASS_GetEnv
const BASS_Env_t * BASS_GetEnv()
Location: ble_bass.h:146
BASS_IsAdded
bool BASS_IsAdded()
Location: ble_bass.h:156
Return
BASS_MsgHandler
void BASS_MsgHandler(ke_msg_id_t const msg_id, void const * param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
Location: ble_bass.h:168
Parameters
Direction | Name | Description |
---|---|---|
in |
msg_id |
Kernel message identifier |
in |
param |
Pointer to constant message parameters |
in |
dest_id |
Destination task identifier |
in |
src_id |
Source task identifier |
DISS_Initialize
int DISS_Initialize(uint16_t features, const struct DISS_DeviceInfo_t * deviceInfo)
Location: ble_diss.h:81
Parameters
Direction | Name | Description |
---|---|---|
in |
features |
The enabled features for the device information service. Values define as enum diss_features in diss_task.h. |
in |
deviceInfo |
Constant pointer to DISS_DeviceInfo_t |
Return
DISS_ProfileTaskAddCmd
void DISS_ProfileTaskAddCmd()
Location: ble_diss.h:87
DISS_EnvGet
const DISS_Env_t * DISS_EnvGet()
Location: ble_diss.h:94
DISS_IsAdded
bool DISS_IsAdded()
Location: ble_diss.h:102
Return
DISS_MsgHandler
void DISS_MsgHandler(ke_msg_id_t const msg_id, void const * param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
Location: ble_diss.h:112
Parameters
Direction | Name | Description |
---|---|---|
in |
msg_id |
Kernel message identifier |
in |
param |
Message parameter |
in |
dest_id |
Destination task identifier |
in |
src_id |
Source task identifier |
DISS_DeviceInfoValueReqInd
void DISS_DeviceInfoValueReqInd(ke_msg_id_t const msgid, void const * param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
Location: ble_diss.h:123
Parameters
Direction | Name | Description |
---|---|---|
in |
msgid |
Kernel message identifier |
in |
param |
Message parameters in format of struct diss_value_req_ind |
in |
dest_id |
Destination task identifier |
in |
src_id |
Source task identifier |