Bluetooth Low Energy Stack Abstraction Function Documentation

 

GAP_Initialize

void GAP_Initialize()

 

Location: ble_gap.h:181

 

Initialize GAP environment.

 

Initialize GAP environment after each GAPM reset.

 

GAP_GetEnv

const GAP_Env_t * GAP_GetEnv()

 

Location: ble_gap.h:190

 

Get GAP environment.

 

Initialize GAP environment after each GAPM reset.
Returns:
Pointer to GAP environment structure

Returns:
Pointer to GAP environment structure

 

GAP_GetProfileAddedTaskId

uint16_t * GAP_GetProfileAddedTaskId()

 

Location: ble_gap.h:197

 

Get GAP environment added profiles task identifiers.

 


Returns:
Pointer to an array of added profiles task identifiers

 

GAP_IsAddrPrivateResolvable

bool GAP_IsAddrPrivateResolvable(const uint8_t * addr, uint8_t addrType)

 

Location: ble_gap.h:206

 

Check address if its private resolvable.

 


Returns:
True if address is private resolvable false otherwise

 

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

 

Add GAP advertise data.

 

Add BLE advertisement data and scan response data to buffer newDataLen Advertisement data length to add newDataFlag Type of advertisement data newData Pointer to new advertisement data to add resultAdvData Pointer to resultant advertisement data buffer resultAdvDataLen Length of resultant advertisement data
Returns:
True if new advertisement data is added false otherwise

Returns:
True if new advertisement data is added false otherwise

 

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 functions.

 

Perform GAPM software reset Do software reset using GAPM_RESET operation.

 

GAPM_PlatformReset

void GAPM_PlatformReset()

 

Location: ble_gap.h:240

 

Perform GAPM platform reset.

 

Do platform reset using GAPM_PLF_RESET operation.

 

GAPM_ResetCmd

void GAPM_ResetCmd(enum gapm_operation operation)

 

Location: ble_gap.h:247

 

Perform GAPM reset with specified GAPM operation.

 

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

 

Prepare and send set the device configuration.

 

Set the device configuration such as device role, manage device address type, privacy configuration, GAP/GATT service start, configure data length extension, set specific write permissions in GAP database, enable or not audio features.

NOTE: : This command is allowed only when no link is established

deviceConfig Pointer to constant GAPM set device configuration command

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

 

get Device configuration

 

Get the device configuration such as device role, manage device address type, privacy configuration, GAP/GATT service start, configure data length extension, set specific write permissions in GAP database, enable or not audio features.
Returns:
Pointer to constant constant GAPM set device configuration command

Returns:
Pointer to constant constant GAPM set device configuration command

 

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

 

Prepare and Send GAPM_PROFILE_TASK_ADD_CMD to the Bluetooth stack.

 

Prepare and send GAPM_PROFILE_TASK_ADD_CMD to the Bluetooth stack to allocate a task for a specific profile (service or client). sec_lvl Security level prf_task_id Profile task identifier of profile to add app_task Application task number start_hdl Service start handle (0 for dynamically allocated in attribute database) param Pointer to parameter value to initialize profile paramSize Size of parameter

 

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

 

Get number of profiles added by the Bluetooth stack.

 

Get the GAP environment variable that keeps track of number of added GAPM profiles.
Returns:
Number of GAPM profile added successfully

Returns:
Number of GAPM profile added successfully

 

GAPM_LepsmRegisterCmd

void GAPM_LepsmRegisterCmd(uint16_t le_psm, uint16_t app_task, uint8_t sec_lvl)

 

Location: ble_gap.h:310

 

Prepare and send GAPM_LEPSM_REGISTER_CMD to the Bluetooth stack.

 

Prepare and send GAPM_LEPSM_REGISTER_CMD to register an LE protocol/Service multiplexer ID in the device allowing a peer device to create LE credit based connection on it. le_psm LE protocol/service multiplexer app_task Application task number sec_lvl Security level

 

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

 

Prepare and send GAPM_GEN_RAND_ADDR_CMD to the Bluetooth stack.

 

Prepare and send GAPM_LEPSM_REGISTER_CMD to generate a random device address without starting any air operation. rnd_type Random address type

 

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

 

Prepare and send GAPM_RESOLV_ADDR_CMD to the Bluetooth stack.

 

Prepare and send GAPM_RESOLV_ADDR_CMD to resolve a random address using array of IRK exchanged and bonded with device during pairing operation. conidx Connection identifier peerAddr Resolvable random address to solve

 

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

 

Message handler for GAPM events.

 

This function receives GAPM events from he Bluetooth stack and perform actions accordingly. It initialize GAP and GATT at reset and also manages GAPM states and the GAP environment. msg_id Kernel message identifier param Pointer to constant parameter dest_id Constant destination kernel identifier src_id Constant source kernel identifier

 

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

 

Prepare and send GAPM_LIST_SET_CMD to set the white list content.

 

Prepare and send GAPM_LIST_SET_CMD to set the content of the white list. operation GAPM operation code to set the content of white list nb Number of entries to be added in the list devices_wl Pointer to structure containing list of addresses to be added in the white list

 

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

 

Prepare and send GAPM_LIST_SET_CMD to set the resolving list content.

 

Prepare and send GAPM_LIST_SET_CMD to set the content of the resolving list. operation GAPM operation code to set the content of white list nb Number of entries to be added in the list rl_devinfo Pointer to structure containing list of addresses to be added in the resolving list

 

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

 

Check if IRK is valid.

 

Function checks if a valid IRK has been previously exchanged or not. bond_info Pointer to constant bond information
Returns:
True if irk_exchanged in the specified bond_info is nonzero, false otherwise

Returns:
True if irk_exchanged in the specified bond_info is nonzero, false otherwise

 

Parameters

Direction Name Description

in

bond_info

Pointer to constant bond information

 

WhiteList_ResolveList_Update

void WhiteList_ResolveList_Update()

 

Location: ble_gap.h:389

 

Update the white list and the resolve List.

 

Copies the addresses of the devices in the bond list and updates them in the Bluetooth stack's white list and the resolvable list (if applicable).

 

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

 

GAPM air operations.

 

Prepare and send GAPM_ACTIVITY_CREATE_CMD to create an advertising activity Prepare and send GAPM_ACTIVITY_CREATE_CMD with operation GAPM_CREATE_ADV_ACTIVITY to create an advertising activity. actv_status Pointer to GAPM activity status own_addr_type Bluetooth device`s own address type adv_param Pointer to constant advertising parameters structure
Returns:
False if no activity slot found, true otherwise

Returns:
False if no activity slot found, true otherwise

 

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

 

Prepare and send GAPM_ACTIVITY_CREATE_CMD to create scan activity.

 

Prepare and send GAPM_ACTIVITY_CREATE_CMD with operation GAPM_CREATE_SCAN_ACTIVITY to create scan activity. actv_status Pointer to GAPM activity status own_addr_type Bluetooth device`s own address type
Returns:
False if no activity slot found, true otherwise

Returns:
False if no activity slot found, true otherwise

 

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

 

Prepare and send GAPM_ACTIVITY_CREATE_CMD to create an initiating activity.

 

Prepare and send GAPM_ACTIVITY_CREATE_CMD with operation GAPM_CREATE_INIT_ACTIVITY to create an initiating activity. actv_status Pointer to GAPM activity status own_addr_type Bluetooth device`s own address type
Returns:
False if no activity slot found, true otherwise

Returns:
False if no activity slot found, true otherwise

 

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

 

Prepare and send GAPM_ACTIVITY_CREATE_CMD to create a periodic sync activity.

 

Prepare and send GAPM_ACTIVITY_CREATE_CMD with operation GAPM_CREATE_PERIOD_SYNC_ACTIVITY to create a periodic synchronization activity. actv_status Pointer to GAPM activity status own_addr_type Bluetooth device`s own address type
Returns:
False if no activity slot found, true otherwise

Returns:
False if no activity slot found, true otherwise

 

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

 

Prepare and send GAPM_ACTIVITY_START_CMD to start an advertising activity.

 

Prepare and send GAPM_ACTIVITY_START_CMD to request the host to start a previously created advertising activity. actv_idx Activity identifier duration Advertising duration (in unit of 10ms). 0 means that advertising continues until the host disables it. max_adv_evt Maximum number of extended advertising events the controller shall attempt to send prior to terminating the extended advertising
Returns:
False if no activity slot found, true otherwise

Returns:
False if no activity slot found, true otherwise

 

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

 

Prepare and send GAPM_ACTIVITY_START_CMD to start an initiating activity.

 

Prepare and send GAPM_ACTIVITY_START_CMD to request the host to start previously created initiating activity. actv_idx Activity identifier initParam Pointer to initiating parameters structure
Returns:
False if no activity slot found, true otherwise

Returns:
False if no activity slot found, true otherwise

 

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

 

Prepare and send GAPM_ACTIVITY_START_CMD to start a scanning activity.

 

Prepare and send GAPM_ACTIVITY_START_CMD to request the host to start previously created scanning activity. actv_idx Activity identifier scanParam Pointer to scan parameters structure
Returns:
False if no activity slot found, true otherwise

Returns:
False if no activity slot found, true otherwise

 

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

 

Prepare and send GAPM_ACTIVITY_START_CMD to start a periodic sync activity.

 

Prepare and send GAPM_ACTIVITY_START_CMD to request the host to start previously created periodic synchronization activity. actv_idx Activity identifier per_sync_param Pointer to periodic sync parameters structure
Returns:
False if no activity slot found, true otherwise

Returns:
False if no activity slot found, true otherwise

 

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

 

Prepare and send GAPM_ACTIVITY_START_CMD to start an activity.

 

Prepare and send GAPM_ACTIVITY_START_CMD to request the host to start previously created activity. actv_idx Activity identifier u_param Pointer to union to containing activity parameters
Returns:
False if no activity slot found, true otherwise

Returns:
False if no activity slot found, true otherwise

 

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

 

Prepare and send GAPM_ACTIVITY_STOP_CMD to stop a specified activity.

 

Prepare and send GAPM_ACTIVITY_STOP_CMD with operation GAPM_STOP_ACTIVITY request the host to stop a specified activity. actv_idx Activity identifier
Returns:
False if activity does not exist, true otherwise

Returns:
False if activity does not exist, true otherwise

 

Parameters

Direction Name Description

in

actv_idx

Activity identifier

 

GAPM_ActivityStopAll

bool GAPM_ActivityStopAll()

 

Location: ble_gap.h:531

 

Prepare and send GAPM_ACTIVITY_STOP_CMD to stop all existing activities.

 

Prepare and send GAPM_ACTIVITY_STOP_CMD with operation GAPM_STOP_ALL_ACTIVITIES request the host to stop all existing activities.
Returns:
False if activity does not exist, true otherwise

Returns:
False if activity does not exist, true otherwise

 

GAPM_ActivityStopCmd

bool GAPM_ActivityStopCmd(uint8_t operation, uint8_t actv_idx)

 

Location: ble_gap.h:543

 

Prepare and send GAPM_ACTIVITY_STOP_CMD to stop a specified activity.

 

Prepare and send GAPM_ACTIVITY_STOP_CMD with operation GAPM_STOP_ACTIVITY request the host to stop a specified activity. operation GAPM operation code [GAPM_STOP_ACTIVITY or GAPM_STOP_ALL_ACTIVITIES] actv_idx Activity identifier (used only if operation is GAPM_STOP_ACTIVITY)
Returns:
False if activity does not exist, true otherwise

Returns:
False if activity does not exist, true otherwise

 

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

 

Prepare and send GAPM_ACTIVITY_DELETE_CMD to delete a specified activity.

 

Prepare and send GAPM_ACTIVITY_DELETE_CMD with operation GAPM_DELETE_ACTIVITY to request the host to delete an existing specified activity. actv_idx Activity identifier (used only if operation is GAPM_DELETE_ACTIVITY)
Returns:
False if activity does not exist, true otherwise

Returns:
False if activity does not exist, true otherwise

 

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

 

Prepare and send GAPM_ACTIVITY_DELETE_CMD to delete all the activities.

 

Prepare and send GAPM_ACTIVITY_DELETE_CMD with operation GAPM_DELETE_ALL_ACTIVITIES to request the host to delete all existing activities.
Returns:
False if activity does not exist, true otherwise

Returns:
False if activity does not exist, true otherwise

 

GAPM_DeleteActivityCmd

bool GAPM_DeleteActivityCmd(uint8_t operation, uint8_t actv_idx)

 

Location: ble_gap.h:576

 

Prepare and send GAPM_ACTIVITY_DELETE_CMD to delete activity/activities.

 

Prepare and send GAPM_ACTIVITY_DELETE_CMD to request the host to delete either an activity or all currently existing activities. operation GAPM operation code [GAPM_DELETE_ACTIVITY or GAPM_DELETE_ALL_ACTIVITIES] actv_idx Activity identifier (used only if operation is GAPM_DELETE_ACTIVITY)
Returns:
False if activity does not exist, true otherwise

Returns:
False if activity does not exist, true otherwise

 

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

 

Prepare and send GAPM_SET_ADV_DATA_CMD to set an advertising data or scan response data or periodic advertising data.

 

Prepare and send GAPM_SET_ADV_DATA_CMD to either set an advertising data or the scan response data or the periodic advertising data for a given advertising activity identified by activity ID. operation GAPM operation code (GAPM_SET_ADV_DATA or GAPM_SET_SCAN_RSP_DATA or GAPM_SET_PERIOD_ADV_DATA) actv_idx Activity identifier length Length of data data Pointer to data
Returns:
False if activity slot not found, true otherwise

Returns:
False if activity slot not found, true otherwise

 

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

 

Prepare and send GAPM_PER_ADV_CTE_TX_CTL_CMD to control CTE transmission in a periodic advertising activity.

 


Returns:
False if activity slot is equal to max number of activity, true otherwise

 

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

 

Prepare and send GAPM_PER_SYNC_IQ_SAMPLING_CTRL_CMD to control capturing IQ samples from the constant tone extension of periodic advertising packets.

 


Returns:
False if activity slot is equal to max number of activity, true otherwise

 

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

 

Prepare and send GAPM_PER_ADV_REPORT_CTRL_CMD to control reception of periodic advertising report in a periodic advertising sync activity.

 


Returns:
False if activity slot is equal to max number of activity, true otherwise

 

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

 

GAPC functions.

 

Prepare and send GAPC_PARAM_UPDATE_CMD to perform an update on parameters Prepare and send GAPC_PARAM_UPDATE_CMD to perform an update of connection parameters. conidx Connection identifier intv_min Minimum of connection interval (value = intv_max * 1.25 ms) intv_max Maximum of connection interval (value = intv_max * 1.25 ms) time_out Link supervision timeout (value = time_out * 10 ms) latency connection latency ce_len_min Minimum CE length (value = ce_len_min * 0.625 ms) ce_len_max Maximum CE length (value = ce_len_min * 0.625 ms)

 

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

 

Prepare and send GAPC_PARAM_UPDATE_CFM to accept or reject connection parameters.

 

Prepare and send GAPC_PARAM_UPDATE_CFM to accept or reject connection parameters proposed by the peer device. conidx Connection identifier accept Accept(0x01) or reject(0x00) slave connection parameters ce_len_min Minimum CE length (value = ce_len_min * 0.625 ms) ce_len_max Maximum CE length (value = ce_len_min * 0.625 ms)

 

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

 

Prepare and send GAPC_CONNECTION_CFM in a response to connection request.

 

Prepare and send GAPC_CONNECTION_CFM in a response to connection request from the peer to enable local attribute tasks and security manager for the connection. conidx Connection identifier param Pointer to GAPC connection confirmation structure

 

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

 

Prepare and send GAPC_DISCONNECT_CMD to disconnect link.

 

Prepare and send GAPC_DISCONNECT_CMD to request a disconnection of the link. conidx Connection identifier reason Reason for disconnection

 

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

 

Check if the specified connection is active.

 

Check if specified connection ID is active or not. conidx Connection identifier
Returns:
True if given connection id have valid GAP connection handle, false otherwise

Returns:
True if given connection id have valid GAP connection handle, false otherwise

 

Parameters

Direction Name Description

in

conidx

Connection identifier

 

GAPC_DisconnectAll

void GAPC_DisconnectAll(uint8_t reason)

 

Location: ble_gap.h:707

 

Prepare and send GAPC_DISCONNECT_CMD to disconnect all the links.

 

Prepare and send GAPC_DISCONNECT_CMD to request disconnection for each active connections. reason Reason for disconnection

 

Parameters

Direction Name Description

in

reason

Reason for disconnection

 

GAPC_ConnectionCount

uint8_t GAPC_ConnectionCount()

 

Location: ble_gap.h:714

 

Get the number of active connection count.

 


Returns:
Number of active connection count

 

GAPC_MasterConnectionCount

uint8_t GAPC_MasterConnectionCount()

 

Location: ble_gap.h:721

 

Get the master connection count.

 


Returns:
Number of master connection count

 

GAPC_SlaveConnectionCount

uint8_t GAPC_SlaveConnectionCount()

 

Location: ble_gap.h:728

 

Get the slave connection count.

 


Returns:
Number of slave connection count

 

GAPC_GetConnectionInfo

const struct gapc_connection_req_ind * GAPC_GetConnectionInfo(uint8_t conidx)

 

Location: ble_gap.h:738

 

Get the connection information of a specified connection ID.

 

Get GAPC connection information of a specified connection ID. conidx Connection identifier
Returns:
Pointer to constant structure gapc_connection_req_ind

Returns:
Pointer to constant structure gapc_connection_req_ind

 

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

 

Prepare and send GAPC_GET_DEV_INFO_CFM to send the device name.

 

Prepare and send GAPC_GET_DEV_INFO_CFM to send the device name information to the peer device. conidx Connection identifier devName Pointer to device name

 

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

 

Prepare and send GAPC_GET_DEV_INFO_CFM to send the device appearance.

 

Prepare and send GAPC_GET_DEV_INFO_CFM to send the device appearance icon to the peer device. conidx Connection identifier appearance Appearance icon

 

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

 

Prepare and send GAPC_GET_DEV_INFO_CFM to send device slave preferred parameters.

 

Prepare and send GAPC_GET_DEV_INFO_CFM to to send device slave preferred parameters to peer device. conidx Connection identifier con_intv_min Minimum connection interval (value = con_intv_min * 1.25 ms) con_intv_max Maximum connection interval (value = con_intv_max * 1.25 ms) slave_latency Slave latency conn_timeout Connection supervision timeout (value = conn_timeout * 10 ms)

 

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

 

Prepare and send GAPC_GET_DEV_INFO_CFM to send requested information.

 

Prepare and send GAPC_GET_DEV_INFO_CFM to send requested information to the peer device. conidx Connection identifier req Requested information dat Pointer to constant union GAPC device information value

 

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

 

Prepare and send GAPC_SET_DEV_INFO_CFM to confirm if the requested device information was written.

 

Prepare and send GAPC_SET_DEV_INFO_CFM to provide confirmation to the Bluetooth stack if the requested device information was written. conidx Connection identifier req Requested information (GAPC_DEV_NAME or GAPC_DEV_APPEARANCE) accept True if the write request has been approved, false otherwise
Returns:
False if req is not GAPC_DEV_NAME or GAPC_DEV_APPEARANCE, true otherwise

Returns:
False if req is not GAPC_DEV_NAME or GAPC_DEV_APPEARANCE, true otherwise

 

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

 

GAPC bond and encryption operations.

 

Prepare and send GAPC_BOND_CFM to send confirmation to a bond request Prepare and send GAPC_BOND_CFM to provide confirmation of the receipt of a GAPC_BOND_REQ_IND message. conidx Connection identifier request Bond request type accept Accept(0x01) or reject(0x00) request data Pointer to constant GAPC bond confirmation data union

 

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

 

Prepare and send GAPC_ENCRYPT_CMD to request encrypting the connection link.

 

Prepare and send GAPC_ENCRYPT_CMD as the master to request initiation of the link encryption procedure. conidx Connection identifier ediv Encryption diversifier randnb Pointer to constant random number ltk Pointer to constant long term key key_size Size of LTK key

 

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

 

Prepare and send GAPC_ENCRYPT_CFM to confirm an encryption request.

 

Prepare and send GAPC_ENCRYPT_CFM to provide confirmation of the receipt of a GAPC_ENCRYPY_REQ_IND message. conidx Connection identifier found Nonzero if LTK is found for peer device, zero otherwise ltk Pointer to constant long term key key_size Size of LTK key

 

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

 

Prepare and send GAPC_BOND_CMD to initiate a bond procedure.

 

Prepare and send GAPC_BOND_CMD to the master of the link in order to initiate the bond procedure. conidx Connection identifier pairing Pointer to constant structure pairing information

 

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

 

Check if the connection is bonded.

 

Check if the specified connection ID is active and if it has a valid bond state. conidx Connection identifier
Returns:
True if connection is active and it has valid bond state, false otherwise

Returns:
True if connection is active and it has valid bond state, false otherwise

 

Parameters

Direction Name Description

in

conidx

Connection identifier

 

GAPC_GetBondInfo

const BondInfo_t * GAPC_GetBondInfo(uint8_t conidx)

 

Location: ble_gap.h:881

 

Get bond information for the connection.

 

Get bond information for a specified connection ID. conidx Connection identifier
Returns:
Pointer to constant bond information structure if connection is active and its bonded, NULL otherwise

Returns:
Pointer to constant bond information structure if connection is active and its bonded, NULL otherwise

 

Parameters

Direction Name Description

in

conidx

Connection identifier

 

GAPC_AddDeviceToBondList

uint16_t GAPC_AddDeviceToBondList(uint8_t conidx)

 

Location: ble_gap.h:891

 

Add device to bond list.

 

Add device with a specified connection ID to bond list. conidx Connection identifier
Returns:
Non-zero if successful, zero otherwise

Returns:
Non-zero if successful, zero otherwise

 

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

 

GAPC message handler.

 

Receives GAPC events from the Bluetooth stack and perform actions accordingly. msg_id Kernel message identifier param Pointer to constant parameter dest_id Constant destination kernel identifier src_id Constant source kernel identifier

 

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

 

GAPC PHY management operations.

 

Prepare and send GAPC_SET_PHY_CMD to set the preferred PHY Prepare and send GAPC_SET_PHY_CMD to set the preferred PHY for current active link. conidx Connection identifier rx_rate Preferred LE PHYs for reception tx_rate Preferred LE PHYs for transmission preferredRate Preferred coding scheme for LE coded

 

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

 

GAPC constant Tone extension operations.

 

Prepare and send GAPC_CTE_TX_CFG_CMD to configure CTE TX Prepare and send GAPC_CTE_TX_CFG_CMD to configure constant tone extension transmission. conidx Connection identifier cte_type CTE types ant_pattern_len Length of switching pattern ant_id Pointer to antenna IDs

 

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

 

Prepare and send GAPC_CTE_RX_CFG_CMD to configure CTE RX.

 

Prepare and send GAPC_CTE_RX_CFG_CMD to configure constant tone extension reception. conidx Connection identifier slot_dur Slot durations (1: 1us, 2: 2us) ant_pattern_len Length of switching pattern ant_id Pointer to antenna IDs sample_en Enable or disable sampling

 

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

 

Prepare and send GAPC_CTE_REQ_CTRL_CMD to control CTE requests.

 

Prepare and send GAPC_CTE_REQ_CTRL_CMD to control constant tone extension requests. conidx Connection identifier cte_type CTE types cte_len Request CTE length (in 8us unit) cte_interval CTE request interval (in no of connection events) enable Enable or disable TX/RX CTE

 

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

 

Prepare and send GAPC_CTE_RSP_CTRL_CMD to control CTE reception.

 

Prepare and send GAPC_CTE_RSP_CTRL_CMD to control constant tone extension reception. conidx Connection identifier enable Enable or disable TX/RX CTE

 

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

 

GAPC local and peer device information operations.

 

Prepare and send GAPC_GET_INFO_CMD to get the peer information Prepare and send GAPC_GET_INFO_CMD to get information about the peer device or about the current active link. conidx Connection identifier operation GAPC requested operation

 

Parameters

Direction Name Description

in

conidx

Connection identifier

in

operation

GAPC requested operation

 

GATT_Initialize

void GATT_Initialize()

 

Location: ble_gatt.h:188

 

GATT initialization.

 

Initialize the GATT environment.

 

GATT_GetEnv

const GATT_Env_t * GATT_GetEnv()

 

Location: ble_gatt.h:197

 

Get GATT environment.

 

Function gets a reference to the internal GATT environment structure.
Returns:
A constant pointer to GATT_Env_t

Returns:
A constant pointer to GATT_Env_t

 

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:209

 

Set GATT environment data.

 

Set the GATT environment discovery service counter (array), custom service database and maximum number of custom services. disc_svc_count Pointer to discovered services count custom_service_db Pointer to custom service database max_cust_svc_num Maximum number of custom services

 

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:219

 

Get the maximum number of custom services in GATT.

 

Function gets the maximum number of custom services in GATT environment.
Returns:
max_cust_svc_num maximum number of custom services

Returns:
max_cust_svc_num maximum number of custom services

 

GATTM_GetServiceAddedCount

uint16_t GATTM_GetServiceAddedCount()

 

Location: ble_gatt.h:228

 

Get GATT added services count.

 

Function gets number of GATT services that have been added.
Returns:
the number of GATT services that have been added

Returns:
the number of GATT services that have been added

 

GATTM_ResetServiceAttributeDatabaseID

void GATTM_ResetServiceAttributeDatabaseID()

 

Location: ble_gatt.h:237

 

Resets GATT services attribute database ID.

 

Function resets GATT services attribute database ID. This should be called before re-adding the attribute databases via GATTM_AddAttributeDatabase() without complete system reset. GATTM_AddAttributeDatabase() without complete system reset.

 

GATTM_AddAttributeDatabase

void GATTM_AddAttributeDatabase(const struct att_db_desc * att_db, uint16_t att_db_len)

 

Location: ble_gatt.h:249

 

Add service and attributes to the Bluetooth stack.

 

Prepare and send GATTM_ADD_SVC_REQ to add services/characteristics into the Bluetooth stack database. att_db Pointer to constant custom service attribute database att_db_len Number of elements in the att_db array

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:264

 

Get the handle for an attribute.

 

Returns the stack database handle for a certain attribute index. cs_svc_number Custom service number related to attribute attidx Attribute index
Returns:
Handle value, in case of success or 0, in case the attidx or the start handle is invalid

NOTE: The user has used GATT_AddAttributeDatabase() to construct the database and the stack has already finished adding services to the database.


Returns:
Handle value, in case of success or 0, in case the attidx or the start handle is invalid

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:276

 

Handle GATTM messages.

 

Message handler for the GATT manager msg_id Kernel message identifier param Pointer to constant message parameter (unused) dest_id Destination task identifier src_id Source task identifier

 

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:284

 

GATTC initialization.

 

Initialize GATTC

 

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:298

 

GATTC services discovery by UUID.

 

Start a discovery by UUID(GATTC_DISC_BY_UUID_SVC) in a specified handle range. conidx Connection index uuid[] Service UUID uuid_len UUID length (ATT_UUID_16_LEN or ATT_UUID_32_LEN or ATT_UUID_128_LEN) start_hdl Start handle of a discovery range end_hdl End handle of a discovery range

 

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:310

 

GATTC all services discovery.

 

Start a discovery for all services in a specified handle range. conidx Connection index start_hdl Start handle of discovery range end_hdl End handle of discovery range

 

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:322

 

GATTC all characteristics discovery.

 

Start a characteristic discovery for all characteristics in a specified handle range. conidx Connection index start_hdl Start handle of discovery range end_hdl End handle of discovery range

 

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:336

 

GATTC send event.

 

Send GATTC characteristic notification or indication event. conidx Connection index operation GATTC_NOTIFY or GATTC_INDICATE seq_num Operation sequence number handle Characteristic handle length Attribute length value Pointer to attribute data value

 

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:347

 

GATTC send event confirmation.

 

Send a GATTC indication event confirmation. conidx Connection index handle Characteristic handle

 

Parameters

Direction Name Description

in

conidx

Connection index

in

handle

Characteristic handle

 

GATTC_MtuExchange

void GATTC_MtuExchange(uint8_t conidx)

 

Location: ble_gatt.h:356

 

Prepare and send GATTC_EXC_MTU_CMD to start MTU exchange procedure.

 

Prepare and send GATTC_EXC_MTU_CMD to start MTU exchange procedure. conidx Connection index

 

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:370

 

GATTC handle read request indication.

 

Handle a received read request indication from GATT controller. msg_id Kernel message identifier param Pointer to constant message parameters (in format of structure gattc_read_req_ind) dest_id Destination task identifier src_id Source task identifier

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:386

 

GATTC handle write request indication.

 

Handle a received write request indication from GATT controller. msg_id Kernel message identifier param Pointer to constant message parameters (in format of structure gattc_write_req_ind) dest_id Destination task identifier src_id Source task identifier

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:405

 

GATTC request attribute information.

 

Request an attribute info indication to be passed to the upper layers of the Bluetooth stack. Could also be triggered during prepare write to check if attribute modification is authorized by profile/application or not and to get current attribute length. msg_id Kernel message identifier param Pointer to constant message parameters (in format of structure gattc_read_req_ind) dest_id Destination task identifier src_id Source task identifier

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:420

 

Handle GATTM messages.

 

Message handler for GATT manager messages received from kernel msg_id Kernel message identifier param Pointer to constant message parameter (unused) dest_id Destination task identifier src_id Source task identifier

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

 

Read the Bluetooth public address to ble_public_addr.

 

Read the Bluetooth public address from a given location and save it to ble_public_addr (array). ble_addr_location Location to read value from

 

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

 

Read BLE device parameters.

 

Read bluetooth low energy parameters, security keys, and channel assessment parameters that are provided by the application or NVR3. param_id Parameter identifier lengthPtr Pointer to the length of parameter buf Pointer to returned value
Returns:
Indicate if the requested parameter is provided by application

Returns:
Indicate if the requested parameter is provided by application

 

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

 

Generate a pseudo-random number.

 


Returns:
A pseudo-random number

 

srand_func

void srand_func(uint32_t seed)

 

Location: ble_protocol_support.h:104

 

Seeds pseudo-random number generator used by function rand()

 

Parameters

Direction Name Description

in

seed

Seed value

 

BondList_Size

uint8_t BondList_Size()

 

Location: bondlist.h:98

 

Bondlist functions.

 

Get the number of entries in the bond list stored to flash
Returns:
Number of entries in the the bond list with a valid bond state

Returns:
Number of entries in the the bond list with a valid bond state

 

BondList_GetIRKs

uint8_t BondList_GetIRKs(struct gap_sec_key * irks)

 

Location: bondlist.h:108

 

Get the IRKs from bond lists.

 

Get the IRKs from bond lists having valid bond state irks Pointer to gap_sec_key structure
Returns:
Number of IRKs found

Returns:
Number of IRKs found

 

Parameters

Direction Name Description

in

irks

Pointer to gap_sec_key structure

 

BondList_FindByIRK

const BondInfo_t * BondList_FindByIRK(const uint8_t * irk)

 

Location: bondlist.h:117

 

Search for the bond information matching specified IRK in flash.

 


Returns:
If found an entry in flash, return its address as a pointer to a const BondInfo_t element NULL otherwise

 

Parameters

Direction Name Description

in

irk

Matching IRK to search for

 

BondList_FindByAddr

const BondInfo_t * BondList_FindByAddr(const uint8_t * addr, uint8_t addrType)

 

Location: bondlist.h:128

 

Search for the bonding information for a peer device in flash matching specified address and address type.

 


Returns:
If found an entry in flash, return its address as a pointer to a const BondInfo_t element NULL otherwise

 

Parameters

Direction Name Description

in

addr

Address of the peer device to search

in

addrType

Address type of the peer device to search

 

BondList_FlashDefrag

bool BondList_FlashDefrag()

 

Location: bondlist.h:135

 

Squeeze bond information together to make space for a new entry.

 


Returns:
True if successful, false otherwise

 

BondList_Add

uint16_t BondList_Add(BondInfo_t * bond_info)

 

Location: bondlist.h:144

 

Add bond information to the bond list.

 


Returns:
Non-zero if bond information is added to bond list successfully, false otherwise

 

Parameters

Direction Name Description

in

bond_info

Pointer to bond information

 

BondList_Remove

bool BondList_Remove(uint16_t bondStateIndex)

 

Location: bondlist.h:152

 

Remove a bond list entry matching the specified index.

 


Returns:
True if successful, false otherwise

 

Parameters

Direction Name Description

in

bondStateIndex

Index of bond list to remove

 

BondList_RemoveAll

bool BondList_RemoveAll()

 

Location: bondlist.h:160

 

Erase bond list sectors containing bond list information in flash.

 


Returns:
If found an error erasing any sector, return false true otherwise

 

MsgHandler_GetTaskAppDesc

const struct ke_task_desc * MsgHandler_GetTaskAppDesc()

 

Location: msg_handler.h:42

 

Provide an application task descriptor with default handler set to the MsgHandler_Notify function.

 


Returns:
A TASK_APP descriptor to be used in the ke_create_task function

 

MsgHandler_Add

bool MsgHandler_Add(ke_msg_id_t const msg_id, MsgHandlerCallback_t callback)

 

Location: msg_handler.h:58

 

Add/subscribe a message handler callback function.

 

If the msg_id argument is a message identifier (such as GAPM_CMP_EVT), the callback function is called only when the specific event is triggered
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
msg_id A message identifier (such as GAPM_CMP_EVT) or a task identifier (such as TASK_ID_GAPM) callback A pointer to the callback function that should be called when an event matching msg_id happens
Returns:
True if it was able to add/register the handler, false otherwise

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:
True if it was able to add/register the handler, false otherwise

 

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

 

Notify the callback functions associated with the msg_id.

 

This function searches the list of handlers added using MsgHandler_Add and notify each one with matching msg_id.
It also makes sure to call the BLE abstraction message handlers prior to any application message handler msg_id A message identifier (such as GAPM_CMP_EVT) or a task identifier (such as TASK_ID_GAPM) param Message parameter dest_id Destination task identifier src_id Source task identifier
Returns:
KE_MSG_CONSUMED back to the kernel

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:
KE_MSG_CONSUMED back to the kernel

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

 

Initialize BASC environment.

 

Initialize battery service client environment and configure message handlers.

 

BASC_EnableReq

void BASC_EnableReq(uint8_t conidx)

 

Location: ble_basc.h:92

 

Enable the client role of the BAS.

 

Prepare and send BASC_ENABLE_REQ to enable the client role of the battery service. conidx Connection index

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

 

Prepare and send BASC_READ_INFO_REQ to read value from peer.

 

Prepare and send BASC_READ_INFO_REQ to read the value of characteristic or descriptor in the peer device database. conidx Connection index bas_nb Battery instance number info Peer battery info type

 

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

 

Send a request to change notification configuration.

 

Prepare and send BASC_BATT_LEVEL_NTF_CFG_REQ to request to change battery level notification configuration in the peer device. conidx Connection index bas_nb Battery instance number ntf_cfg The value of notification configuration

 

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

 

Send a request for periodic battery level update.

 

Configure a kernel timer to periodically send battery level requests. timeout_ms Delay between requests in units of 10ms. If timeout == 0, disable periodic requests.

 

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

 

Read the most recent battery level.

 

Read the most recent value of battery level from the BASC environment. conidx Connection index bas_nb Battery instance number
Returns:
Value of battery level

Returns:
Value of battery level

 

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

 

Get the BASC environment.

 

Return a reference to the internal BASC environment structure.
Returns:
Constant pointer to BASC_Env_t

Returns:
Constant pointer to BASC_Env_t

 

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

 

Handle the BASC events.

 

Handle all the events related to battery service client. msg_id Kernel message identifier param Pointer to constant message parameter dest_id Destination task identifier src_id Source task identifier

 

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

 

Initialize BASS environment.

 

Initialize a battery service server environment and configure message handlers. bas_nb Number of battery instances [1,2]. readBattLevelCallback Pointer to user application callback function that returns the battery value.

 

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

 

BASS configure periodic notification.

 

Configure a battery service to send periodic notifications. timeout Timeout period in units of 10ms. disabled if timeout == 0

 

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

 

BASS notify peers on battery level change.

 

Configure battery service to periodically monitor the battery level according to the timeout. The battery level is queried read through the callback function passed as argument to BASS_Initialize(). Connected peers are only notified if the battery level changes. It triggers a BASS_BATT_LEVEL_CHANGED event, which the user application may subscribe to. timeout Timeout period in units of 10ms. disabled if timeout == 0 BASS_Initialize(). Connected peers are only notified if the battery level changes. It triggers a BASS_BATT_LEVEL_CHANGED event, which the user application may subscribe to.

 

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

 

Add a battery profile in kernel.

 

Send request to add a battery profile in kernel and database.

 

BASS_EnableReq

void BASS_EnableReq(uint8_t conidx)

 

Location: ble_bass.h:124

 

Enable the server role in BAS.

 

Prepare and send BASS_ENABLE_REQ to enable the server role of the battery service. conidx Connection index

 

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

 

Prepare and send BASS_BATT_LEVEL_UPD_REQ for battery level notification.

 

Prepare and send BASS_BATT_LEVEL_UPD_REQ to update the battery level characteristic value for the BAS instance. This value will be stored in the database so that it can be read by the peer device. batt_lvl Battery level [0, 100] bas_nb Battery server instance number

 

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

 

Get the BASS environment.

 

Return a reference to the internal BASS environment structure.
Returns:
Constant pointer to BASS_Env_t

Returns:
Constant pointer to BASS_Env_t

 

BASS_IsAdded

bool BASS_IsAdded()

 

Location: ble_bass.h:156

 

Check if the BASS is added successfully.

 

Returns a boolean indication if the BAS server has been successfully added to the services database.
Returns:
True if the service has been successfully added, false otherwise

Returns:
True if the service has been successfully added, false otherwise

 

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

 

Handle BASS messages.

 

Handle all events related to the battery service server msg_id Kernel message identifier param Pointer to constant message parameters dest_id Destination task identifier src_id Source task identifier

 

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

 

Initialize the device information server service environment and configure message handlers.

 


Returns:
0 if the initialization was successful, < 0 otherwise

 

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

 

Send a request to add the device information service in kernel and database.

 

DISS_EnvGet

const DISS_Env_t * DISS_EnvGet()

 

Location: ble_diss.h:94

 

Return a reference to the internal DISS environment structure.

 


Returns:
A constant pointer to DISS_Env_t

 

DISS_IsAdded

bool DISS_IsAdded()

 

Location: ble_diss.h:102

 

Return a boolean indication if the DISS server has been successfully added to the services database.

 


Returns:
True if the service is added successful, false otherwise

 

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

 

Handle all the events related to the device information service server.

 

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

 

Handle the indication when the peer device requests a value.

 

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