Bluetooth Low Energy Stack Abstraction Function Documentation
GAP_Initialize
void GAP_Initialize()
Location: ble_gap.h:181
GAP_GetEnv
const GAP_Env_t * GAP_GetEnv()
Location: ble_gap.h:190
Returns:
Returns:
GAP_GetProfileAddedTaskId
uint16_t * GAP_GetProfileAddedTaskId()
Location: ble_gap.h:197
Returns:
GAP_IsAddrPrivateResolvable
bool GAP_IsAddrPrivateResolvable(const uint8_t * addr, uint8_t addrType)
Location: ble_gap.h:206
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
addr |
Pointer to address |
|
in |
addrType |
Type of address |
GAP_AddAdvData
bool GAP_AddAdvData(uint8_t newDataLen, enum gap_ad_type newDataFlag, const uint8_t * newData, uint8_t * resultAdvData, uint8_t * resultAdvDataLen)
Location: ble_gap.h:220
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
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 |
GAPM_SoftwareReset
void GAPM_SoftwareReset()
Location: ble_gap.h:233
GAPM_PlatformReset
void GAPM_PlatformReset()
Location: ble_gap.h:240
GAPM_ResetCmd
void GAPM_ResetCmd(enum gapm_operation operation)
Location: ble_gap.h:247
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
operation |
GAPM operation code |
GAPM_SetDevConfigCmd
void GAPM_SetDevConfigCmd(const struct gapm_set_dev_config_cmd * deviceConfig)
Location: ble_gap.h:261
NOTE: : This command is allowed only when no link is established
NOTE: : This command is allowed only when no link is established
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
deviceConfig |
Pointer to constant GAPM set device configuration command |
GAPM_GetDeviceConfig
const struct gapm_set_dev_config_cmd * GAPM_GetDeviceConfig()
Location: ble_gap.h:273
Returns:
Returns:
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:288
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:298
Returns:
Returns:
GAPM_LepsmRegisterCmd
void GAPM_LepsmRegisterCmd(uint16_t le_psm, uint16_t app_task, uint8_t sec_lvl)
Location: ble_gap.h:310
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:320
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:331
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
conidx |
Connection identifier |
|
in |
peerAddr |
Resolvable random address to solve |
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:344
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:357
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:370
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:381
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
bond_info |
Pointer to constant bond information |
WhiteList_ResolveList_Update
bool WhiteList_ResolveList_Update()
Location: ble_gap.h:389
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:406
Returns:
Returns:
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 |
GAPM_ActivityCreateScanCmd
bool GAPM_ActivityCreateScanCmd(GAPM_ActivityStatus_t * actv_status, enum gapm_own_addr own_addr_type)
Location: ble_gap.h:420
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
actv_status |
Pointer to GAPM activity status |
|
in |
own_addr_type |
Bluetooth device`s own address type |
GAPM_ActivityCreateInitCmd
bool GAPM_ActivityCreateInitCmd(GAPM_ActivityStatus_t * actv_status, enum gapm_own_addr own_addr_type)
Location: ble_gap.h:433
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
actv_status |
Pointer to GAPM activity status |
|
in |
own_addr_type |
Bluetooth device`s own address type |
GAPM_ActivityCreatePeriodSyncCmd
bool GAPM_ActivityCreatePeriodSyncCmd(GAPM_ActivityStatus_t * actv_status, enum gapm_own_addr own_addr_type)
Location: ble_gap.h:446
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
actv_status |
Pointer to GAPM activity status |
|
in |
own_addr_type |
Bluetooth device`s own address type |
GAPM_AdvActivityStart
bool GAPM_AdvActivityStart(uint8_t actv_idx, uint16_t duration, uint8_t max_adv_evt)
Location: ble_gap.h:462
Returns:
Returns:
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 |
GAPM_InitActivityStart
bool GAPM_InitActivityStart(uint8_t actv_idx, struct gapm_init_param * initParam)
Location: ble_gap.h:474
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
actv_idx |
Activity identifier |
|
in |
initParam |
Pointer to initiating parameters structure |
GAPM_ScanActivityStart
bool GAPM_ScanActivityStart(uint8_t actv_idx, struct gapm_scan_param * scanParam)
Location: ble_gap.h:486
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
actv_idx |
Activity identifier |
|
in |
scanParam |
Pointer to scan parameters structure |
GAPM_PerSyncActivityStart
bool GAPM_PerSyncActivityStart(uint8_t actv_idx, struct gapm_per_sync_param * per_sync_param)
Location: ble_gap.h:498
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
actv_idx |
Activity identifier |
|
in |
per_sync_param |
Pointer to periodic sync parameters structure |
GAPM_ActivityStartCmd
bool GAPM_ActivityStartCmd(uint8_t actv_idx, union gapm_u_param * u_param)
Location: ble_gap.h:510
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
actv_idx |
Activity identifier |
|
in |
u_param |
Pointer to union to containing activity parameters |
GAPM_ActivityStop
bool GAPM_ActivityStop(uint8_t actv_idx)
Location: ble_gap.h:521
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
actv_idx |
Activity identifier |
GAPM_ActivityStopAll
bool GAPM_ActivityStopAll()
Location: ble_gap.h:531
Returns:
Returns:
GAPM_ActivityStopCmd
bool GAPM_ActivityStopCmd(uint8_t operation, uint8_t actv_idx)
Location: ble_gap.h:543
Returns:
Returns:
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) |
GAPM_DeleteActivity
bool GAPM_DeleteActivity(uint8_t actv_idx)
Location: ble_gap.h:554
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
actv_idx |
Activity identifier (used only if operation is GAPM_DELETE_ACTIVITY) |
GAPM_DeleteAllActivities
bool GAPM_DeleteAllActivities()
Location: ble_gap.h:564
Returns:
Returns:
GAPM_DeleteActivityCmd
bool GAPM_DeleteActivityCmd(uint8_t operation, uint8_t actv_idx)
Location: ble_gap.h:576
Returns:
Returns:
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) |
GAPM_SetAdvDataCmd
bool GAPM_SetAdvDataCmd(uint8_t operation, uint8_t actv_idx, uint8_t length, uint8_t * data)
Location: ble_gap.h:593
Returns:
Returns:
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 |
GAPM_PerAdvCteTxCmd
bool GAPM_PerAdvCteTxCmd(uint8_t actv_idx, bool enable)
Location: ble_gap.h:603
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
actv_idx |
Activity identifier |
|
in |
enable |
Enable or disable CTE transmission |
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:618
Returns:
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 |
GAPM_PerAdvReportCtrlCmd
bool GAPM_PerAdvReportCtrlCmd(uint8_t actv_idx, bool enable)
Location: ble_gap.h:630
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
actv_idx |
Activity identifier |
|
in |
enable |
Enable or disable reception of periodic advertising report |
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:649
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:663
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:675
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:686
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:697
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
conidx |
Connection identifier |
GAPC_DisconnectAll
void GAPC_DisconnectAll(uint8_t reason)
Location: ble_gap.h:707
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
reason |
Reason for disconnection |
GAPC_ConnectionCount
uint8_t GAPC_ConnectionCount()
Location: ble_gap.h:714
Returns:
GAPC_MasterConnectionCount
uint8_t GAPC_MasterConnectionCount()
Location: ble_gap.h:721
Returns:
GAPC_SlaveConnectionCount
uint8_t GAPC_SlaveConnectionCount()
Location: ble_gap.h:728
Returns:
GAPC_GetConnectionInfo
const struct gapc_connection_req_ind * GAPC_GetConnectionInfo(uint8_t conidx)
Location: ble_gap.h:738
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
conidx |
Connection identifier |
GAPC_GetDevInfoCfm_Name
void GAPC_GetDevInfoCfm_Name(uint8_t conidx, const char * devName)
Location: ble_gap.h:749
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:760
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:774
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:788
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:803
Returns:
Returns:
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 |
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:820
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:835
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:849
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_BondCmd
void GAPC_BondCmd(uint8_t conidx, const struct gapc_pairing * pairing)
Location: ble_gap.h:860
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
conidx |
Connection identifier |
|
in |
pairing |
Pointer to constant structure pairing information |
GAPC_IsBonded
bool GAPC_IsBonded(uint8_t conidx)
Location: ble_gap.h:870
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
conidx |
Connection identifier |
GAPC_GetBondInfo
const BondInfo_t * GAPC_GetBondInfo(uint8_t conidx)
Location: ble_gap.h:881
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
conidx |
Connection identifier |
GAPC_AddDeviceToBondList
uint16_t GAPC_AddDeviceToBondList(uint8_t conidx)
Location: ble_gap.h:891
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
conidx |
Connection identifier |
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:903
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_SetPhyCmd
void GAPC_SetPhyCmd(uint8_t conidx, uint8_t rx_rate, uint8_t tx_rate, uint8_t preferredRate)
Location: ble_gap.h:921
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:939
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:954
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:969
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:981
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:996
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
conidx |
Connection identifier |
|
in |
operation |
GAPC requested operation |
GATT_Initialize
void GATT_Initialize()
Location: ble_gatt.h:198
GATT_GetEnv
const GATT_Env_t * GATT_GetEnv()
Location: ble_gatt.h:207
Returns:
Returns:
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
Returns:
Returns:
GATTM_GetServiceAddedCount
uint16_t GATTM_GetServiceAddedCount()
Location: ble_gatt.h:238
Returns:
Returns:
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
NOTE: Triggers a GATTM_ADD_SVC_RSP for every service added.
NOTE: Triggers a GATTM_ADD_SVC_RSP for every service added.
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 |
GATTM_GetHandle
uint16_t GATTM_GetHandle(uint8_t cs_svc_number, uint16_t attidx)
Location: ble_gatt.h:274
Returns:
NOTE: The user has used GATT_AddAttributeDatabase() to construct the database and the stack has already finished adding services to the database.
Returns:
NOTE: The user has used GATT_AddAttributeDatabase() to construct the database and the stack has already finished adding services to the database.
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
cs_svc_number |
Custom service number related to attribute |
|
in |
attidx |
Attribute index |
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
NOTE: Indicate if the message was consumed, compare with KE_MSG_CONSUMED
NOTE: Indicate if the message was consumed, compare with KE_MSG_CONSUMED
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 |
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
NOTE: Indicate if the message was consumed, compare with KE_MSG_CONSUMED
NOTE: Indicate if the message was consumed, compare with KE_MSG_CONSUMED
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 |
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
NOTE: Indicate if the message was consumed, compare with KE_MSG_CONSUMED
NOTE: Indicate if the message was consumed, compare with KE_MSG_CONSUMED
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 |
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
NOTE: Indicate if the message was consumed, compare with KE_MSG_CONSUMED
NOTE: Indicate if the message was consumed, compare with KE_MSG_CONSUMED
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 |
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
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
param_id |
Parameter identifier |
|
in |
lengthPtr |
Pointer to the length of parameter |
|
in |
buf |
Pointer to returned value |
rand_func
int rand_func()
Location: ble_protocol_support.h:97
Returns:
srand_func
void srand_func(uint32_t seed)
Location: ble_protocol_support.h:104
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
seed |
Seed value |
MsgHandler_GetTaskAppDesc
const struct ke_task_desc * MsgHandler_GetTaskAppDesc()
Location: msg_handler.h:42
Returns:
MsgHandler_Add
bool MsgHandler_Add(ke_msg_id_t const msg_id, MsgHandlerCallback_t callback)
Location: msg_handler.h:58
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
Returns:
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
Returns:
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 |
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
It also makes sure to call the BLE abstraction message handlers prior to any application message handler
Returns:
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
It also makes sure to call the BLE abstraction message handlers prior to any application message handler
Returns:
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
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 |
BASC_Initialize
void BASC_Initialize()
Location: ble_basc.h:81
BASC_EnableReq
void BASC_EnableReq(uint8_t conidx)
Location: ble_basc.h:92
NOTE: conidx is valid (between 0 and GAP_MAX_CONNECTIONS-1)
NOTE: conidx is valid (between 0 and GAP_MAX_CONNECTIONS-1)
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
conidx |
Connection index |
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
Returns:
Returns:
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
conidx |
Connection index |
|
in |
bas_nb |
Battery instance number |
BASC_GetEnv
const BASC_Env_t * BASC_GetEnv()
Location: ble_basc.h:146
Returns:
Returns:
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
Returns:
Returns:
BASS_IsAdded
bool BASS_IsAdded()
Location: ble_bass.h:156
Returns:
Returns:
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
Returns:
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 |
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
Returns:
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 |