Go to the documentation of this file.
39 #include "iot_ble_config.h"
40 #include "iot_linear_containers.h"
283 uint32_t connInterval );
298 BTSecurityLevel_t securityLevel,
430 #if ( IOT_BLE_ADD_CUSTOM_SERVICES == 1 )
437 void IotBle_AddCustomServicesCb(
void );
441 #if ( IOT_BLE_SET_CUSTOM_ADVERTISEMENT_MSG == 1 )
uint16_t offset
Definition: iot_ble.h:152
bool includeTxPower
Definition: iot_ble.h:61
uint16_t offset
Definition: iot_ble.h:137
BTStatus_t IotBle_CreateService(BTService_t *pService, IotBleAttributeEventCallback_t pEventsCallbacks[])
Create a new service.
void(* IotBleAttributeEventCallback_t)(IotBleAttributeEvent_t *pEventParam)
Callback called when a request on a attribute is made by the remote device.
Definition: iot_ble.h:123
void(* IotBle_NumericComparisonCallback_t)(BTBdaddr_t *pRemoteBdAddr, uint32_t passKey)
Callback invoked on pairing request from remote device.
Definition: iot_ble.h:309
BTStatus_t status
Definition: iot_ble.h:187
BTStatus_t IotBle_SendIndication(IotBleEventResponse_t *pResp, uint16_t connId, bool confirm)
Send value indication to a remote device.
uint16_t connId
Definition: iot_ble.h:165
BTStatus_t IotBle_Init(void)
Starting point. Initialize the BLE stack and its services. It is up to the application to decide when...
UUID.
Definition: bt_hal_manager_types.h:84
@ eBLEExecWrite
Definition: iot_ble.h:104
uint16_t attrHandle
Definition: iot_ble.h:151
bool isBonded
Definition: iot_ble.h:91
uint16_t serviceDataLen
Definition: iot_ble.h:60
@ eBLENumericComparisonCallback
Definition: iot_ble.h:322
IotBleAttributeEventType_t
Attribute event type.
Definition: iot_ble.h:99
BTStatus_t IotBle_RegisterEventCb(IotBleEvents_t event, IotBleEventsCallbacks_t bleEventsCallbacks)
Used to route event to whatever service requests it.
BLE Event response.
Definition: iot_ble.h:225
uint32_t maxInterval
Definition: iot_ble.h:54
bool execWrite
Definition: iot_ble.h:166
Parameters for confirmation response event.
Definition: iot_ble.h:174
void(* IotBle_ConnectionCallback_t)(BTStatus_t status, uint16_t connId, bool connected, BTBdaddr_t *pRemoteBdAddr)
Callback indicating that a remote device has connected or been disconnected.
Definition: iot_ble.h:250
IotBle_NumericComparisonCallback_t pNumericComparisonCb
Definition: iot_ble.h:337
uint16_t connId
Definition: iot_ble.h:133
uint32_t minInterval
Definition: iot_ble.h:72
BTStatus_t IotBle_GetConnectionInfoList(IotLink_t **pConnectionInfoList)
Send response to the remote device.
uint16_t connId
Definition: iot_ble.h:150
BTStatus_t IotBle_StartAdv(IotBle_StartAdvCallback_t pStartAdvCb)
Start advertisements to listen for incoming connections. Triggers IotBle_StartAdvCallback_t.
IotBleWriteEventParams_t * pParamWrite
Definition: iot_ble.h:199
BTBondState_t
Definition: bt_hal_manager.h:298
Parameters for indication sent event.
Definition: iot_ble.h:184
IotBleConnectionParam_t connectionParams
Definition: iot_ble.h:86
uint32_t transId
Definition: iot_ble.h:146
Basic info contained in an attribute. This is common to all attributes.
Definition: iot_ble.h:213
IotBleIndicationSentEventParams_t * pParamIndicationSent
Definition: iot_ble.h:202
BTStatus_t
Bluetooth Error Status .
Definition: bt_hal_manager_types.h:98
uint8_t * pData
Definition: iot_ble.h:215
BTStatus_t status
Definition: iot_ble.h:175
BTStatus_t IotBle_SendResponse(IotBleEventResponse_t *pResp, uint16_t connId, uint32_t transId)
Send response to the remote device.
IotBle_ConnParameterUpdateRequestCallback_t pConnParameterUpdateRequestCb
Definition: iot_ble.h:336
uint32_t appearance
Definition: iot_ble.h:52
@ eBLEConnParameterUpdateRequestCallback
Definition: iot_ble.h:321
IotBleAttributeEventType_t xEventType
Definition: iot_ble.h:204
IotBle_ConnectionCallback_t pConnectionCb
Definition: iot_ble.h:334
uint16_t connId
Definition: iot_ble.h:90
BTBdaddr_t remoteBdAddr
Definition: iot_ble.h:87
bool needRsp
Definition: iot_ble.h:153
void(* IotBle_ConnParameterUpdateRequestCallback_t)(BTStatus_t status, const BTBdaddr_t *pRemoteBdAddr, IotBleConnectionParam_t *pConnectionParam, uint32_t connInterval)
Callback invoked on BLE_ConnParameterUpdateRequest from remote device.
Definition: iot_ble.h:280
Parameters for write event.
Definition: iot_ble.h:145
Contains the connection info. Return when requested by IotBleGetConnectionInfoList.
Definition: iot_ble.h:84
IotLink_t clientCharDescrListHead
Definition: iot_ble.h:89
size_t size
Definition: iot_ble.h:214
BLE events not directly triggered by a function call. Most of them are triggered by a remote device m...
Definition: iot_ble.h:332
@ eBLEConnection
Definition: iot_ble.h:319
IotBle_MtuChangedCallback_t pMtuChangedCb
Definition: iot_ble.h:333
Connection parameters.
Definition: iot_ble.h:71
BTStatus_t IotBle_RemoveBond(const BTBdaddr_t *pRemoteBdAddr)
Remove a bonded device. Will trigger pBondedCb.
IotBleReadEventParams_t * pParamRead
Definition: iot_ble.h:198
@ eBLERead
Definition: iot_ble.h:100
IotBleExecWriteEventParams_t * pParamExecWrite
Definition: iot_ble.h:200
@ eBLEWritePrepare
Definition: iot_ble.h:103
void(* IotBle_MtuChangedCallback_t)(uint16_t connId, uint16_t mtu)
Callback invoked when the MTU for a given connection changes.
Definition: iot_ble.h:239
Structure containing all advertisement parameters.
Definition: iot_ble.h:51
uint16_t handle
Definition: iot_ble.h:176
bool setScanRsp
Definition: iot_ble.h:63
Advertising Name Format.
Definition: bt_hal_manager_adapter_ble.h:94
BTUuid_t * pUUID1
Definition: iot_ble.h:57
BTStatus_t IotBle_Off(void)
Turns off the BLE radio.
size_t handle
Definition: iot_ble.h:217
uint8_t * pValue
Definition: iot_ble.h:148
void(* IotBle_StartAdvCallback_t)(BTStatus_t status)
Callback indicating the status of start advertisement operation. Invoked on BLE_StartAdv.
Definition: iot_ble.h:261
@ eBLEWrite
Definition: iot_ble.h:101
BTUuid_t uuid
Definition: iot_ble.h:216
BTRspErrorStatus_t
Error status sent inside response to a read or write from the client.
Definition: bt_hal_gatt_server.h:54
@ eBLEWriteNoResponse
Definition: iot_ble.h:102
BTBdaddr_t * pRemoteBdAddr
Definition: iot_ble.h:147
Generic BLE attribute.
Definition: bt_hal_gatt_types.h:234
uint32_t transId
Definition: iot_ble.h:163
char * pServiceData
Definition: iot_ble.h:56
BT GATT Server provides the interfaces to use Bluetooth GATT server feature.
Parameters for write executed event.
Definition: iot_ble.h:162
IotBleRespConfirmEventParams_t * pParamRespConfirm
Definition: iot_ble.h:201
BTStatus_t IotBle_On(void)
Turns on the BLE radio.
T HAL provides the standard defintions used by BT GATT interfaces.
size_t attrDataOffset
Definition: iot_ble.h:227
BTRspErrorStatus_t rspErrorStatus
Definition: iot_ble.h:229
IotBle_PairingStateChanged_t pGAPPairingStateChangedCb
Definition: iot_ble.h:335
bool isPrep
Definition: iot_ble.h:154
BTAttribute_t * pAttribute
Definition: iot_ble.h:185
BTStatus_t IotBle_ConfirmNumericComparisonKeys(BTBdaddr_t *pBdAddr, bool keyAccepted)
Confirm key for numeric comparison.
BTUuid_t * pUUID2
Definition: iot_ble.h:58
BTSecurityLevel_t securityLevel
Definition: iot_ble.h:88
void(* IotBle_PairingStateChanged_t)(BTStatus_t status, BTBdaddr_t *pRemoteBdAddr, BTBondState_t bondstate, BTSecurityLevel_t securityLevel, BTAuthFailureReason_t reason)
Callback invoked when pairing state is changed.
Definition: iot_ble.h:295
BTBdaddr_t * pRemoteBdAddr
Definition: iot_ble.h:164
Parameters for read event.
Definition: iot_ble.h:132
IotBleAttributeData_t * pAttrData
Definition: iot_ble.h:226
uint32_t transId
Definition: iot_ble.h:134
uint16_t manufacturerLen
Definition: iot_ble.h:59
@ eBLEIndicationConfirmReceived
Definition: iot_ble.h:106
uint32_t minInterval
Definition: iot_ble.h:53
BTAuthFailureReason_t
Authentication failure reasons.
Definition: bt_hal_manager.h:135
BTStatus_t IotBle_StopAdv(IotBle_StopAdvCallback_t pStopAdvCb)
Stop advertisements to listen for incoming connections. Triggers IotBle_StopAdvCallback_t.
BTStatus_t IotBle_ConnParameterUpdateRequest(const BTBdaddr_t *pRemoteBdAddr, IotBleConnectionParam_t *pConnectionParam)
Request an update of the connection parameters.
IotLink_t connectionList
Definition: iot_ble.h:85
BTStatus_t IotBle_UnRegisterEventCb(IotBleEvents_t event, IotBleEventsCallbacks_t bleEventsCallbacks)
Remove a subscription to an event.
BTStatus_t IotBle_GetConnectionInfo(uint16_t connId, IotBleConnectionInfoListElement_t **pConnectionInfo)
Get connection info for a specific connection ID.
BTStatus_t eventStatus
Definition: iot_ble.h:228
char * pManufacturerData
Definition: iot_ble.h:55
BT/BLE address.
Definition: bt_hal_manager_types.h:67
@ eNbEvents
Definition: iot_ble.h:323
uint16_t connId
Definition: iot_ble.h:186
uint32_t length
Definition: iot_ble.h:149
BTStatus_t IotBle_DeleteService(BTService_t *pService)
Delete a local service.
@ eBLEPairingStateChanged
Definition: iot_ble.h:320
uint32_t maxInterval
Definition: iot_ble.h:73
@ eBLEMtuChanged
Definition: iot_ble.h:318
BLE Attribute event.
Definition: iot_ble.h:195
uint16_t attrHandle
Definition: iot_ble.h:136
uint32_t timeout
Definition: iot_ble.h:75
@ eBLEResponseConfirmation
Definition: iot_ble.h:105
void * pvPtr
Definition: iot_ble.h:338
BTStatus_t IotBle_SetDeviceName(const char *pName, size_t length)
Set device name for BLE.
BTGattAdvName_t name
Definition: iot_ble.h:62
BTBdaddr_t * pRemoteBdAddr
Definition: iot_ble.h:135
IotBleEvents_t
enum listing all the BLE events (not directly triggered by a function call)
Definition: iot_ble.h:317
uint32_t latency
Definition: iot_ble.h:74
void(* IotBle_StopAdvCallback_t)(BTStatus_t status)
Callback indicating the status of stop advertisement operation. Invoked on BLE_StopAdv.
Definition: iot_ble.h:269