BLE_API
v2.1.3
|
Functions | |
BleStackStatus | setBLE_BleStackInit (void) |
void | setBLE_BleStackGpio_Isr (void) |
BleStackStatus | setBLE_BleDeviceAddr (BLE_Addr_Param *addrParam) |
BleStackStatus | getBLE_BleDeviceAddr (BLE_Addr_Param *addrParam) |
BleStackStatus | setBLE_AdvParam (BLE_Adv_Param *advParam) |
BleStackStatus | setBLE_AdvData (uint8_t *advData, uint8_t length) |
BleStackStatus | setBLE_ScanRspData (uint8_t *scanRspData, uint8_t length) |
BleStackStatus | setBLE_AdvEnable (uint8_t hostId) |
BleStackStatus | setBLE_AdvDisable (void) |
BleStackStatus | setBLE_ScanParam (BLE_Scan_Param *scanParam) |
BleStackStatus | setBLE_ScanEnable (void) |
BleStackStatus | setBLE_ScanDisable (void) |
BleStackStatus | getBLE_GapAdDataByAdType (BLE_Event_ScanReportParam *rptData, BLE_GAP_AD_TYPE parsingAdType, uint8_t *parsingData, uint8_t *parsingDataLen) |
BleStackStatus | setBLE_ConnCreate (uint8_t hostId, BLE_Addr_Param *peerAddrParam, BLE_Scan_Param *scanParam, BLE_Conn_Param *connParam) |
BleStackStatus | setBLE_ConnCreateWithSetScanParam (uint8_t hostId, BLE_Addr_Param *peerAddrParam, BLE_Conn_Param *connParam) |
BleStackStatus | setBLE_ConnCancel (void) |
BleStackStatus | setBLE_Disconnect (uint8_t hostId) |
BleStackStatus | setBLE_ConnUpdate (uint8_t hostId, BLE_Conn_Param *connParam) |
BleStackStatus | setBLE_TxPower (uint8_t power_index, BleMode bleMode) |
BleStackStatus | setBLE_Phy (uint8_t hostId, BLE_Phy_Param *blePhy) |
BleStackStatus | getBLE_Phy (uint8_t hostId) |
BleStackStatus | getBLE_RssiValue (uint8_t hostId) |
BleStackStatus | setBLE_SecurityRequest (uint8_t hostId) |
BleStackStatus | setBLE_PairingPassKey (uint8_t hostId, uint32_t hexPasskey) |
BleStackStatus | setBLE_IOCapabilities (BLE_IOCaps_Param *ioCapsParam) |
BleStackStatus | setBLE_BondingFlags (BLE_BondingFlags_Param *bondingParam) |
BleStackStatus | setBLE_DataLength (uint8_t hostId, BLE_DataLength_Param *dataLenParam) |
BleStackStatus | setBLE_CompanyId (uint16_t companyId) |
BleStackStatus | getBLEGATT_MtuSize (uint8_t hostId, uint16_t *mtuSize) |
BleStackStatus | getBLEGATT_HandleNumAddr (uint8_t hostId, BleGattRole gattRole, ATTRIBUTE_BLE *attributeElement, void *handleNumAddr) |
BleStackStatus | getBLEGATT_RestoreCCCDValueFromBond (uint8_t hostId) |
BleStackStatus | setBLEGATT_ReparseAttDatabase (uint8_t hostId) |
BleStackStatus | setBLEGATT_ExchangeMtuRequest (uint8_t hostId, uint16_t clientRxMtu) |
BleStackStatus | setBLEGATT_ReadCharacteristicValue (uint8_t hostId, uint16_t hdlNum) |
BleStackStatus | setBLEGATT_ReadLongCharacteristicValue (uint8_t hostId, uint16_t hdlNum, uint16_t Offset) |
BleStackStatus | setBLEGATT_ConfigCCCD (uint8_t hostId, uint16_t hdlNum, BleGattCCCDValue cccdVal) |
BleStackStatus | setBLEGATT_Write (uint8_t hostId, uint16_t hdlNum, uint8_t *data, uint16_t length) |
BleStackStatus | setBLEGATT_WriteWithoutRsp (uint8_t hostId, uint16_t hdlNum, uint8_t *data, uint16_t length) |
BleStackStatus | setBLEGATT_PrepareWrite (uint8_t hostId, uint16_t hdlNum, uint8_t *data, uint16_t length) |
BleStackStatus | setBLEGATT_ExecuteWrite (uint8_t hostId, uint16_t hdlNum, uint8_t flag) |
BleStackStatus | setBLEGATT_PreferredMtuSize (uint8_t hostId, uint16_t preferredRxMtu) |
BleStackStatus | setBLEGATT_ReadByTypeRsp (uint8_t hostId, uint16_t hdlNum, uint8_t *data, uint16_t length) |
BleStackStatus | setBLEGATT_ReadRsp (uint8_t hostId, uint16_t hdlNum, uint8_t *data, uint16_t length) |
BleStackStatus | setBLEGATT_GeneralReadRsp (uint8_t hostId, uint16_t hdlNum, uint8_t *data, uint16_t length) |
BleStackStatus | setBLEGATT_ReadBlobRsp (uint8_t hostId, uint16_t hdlNum, uint8_t *data, uint16_t length) |
BleStackStatus | setBLEGATT_Indication (uint8_t hostId, uint16_t hdlNum, uint8_t *data, uint16_t length) |
BleStackStatus | setBLEGATT_Notification (uint8_t hostId, uint16_t hdlNum, uint8_t *data, uint16_t length) |
BleStackStatus | setBLEGATT_ErrorRsp (uint8_t hostId, uint16_t hdlNum, BleAttOpcode opcode, BleAttErrorRsp errRsp) |
BleStackStatus getBLE_BleDeviceAddr | ( | BLE_Addr_Param * | addrParam | ) |
Get BLE Device Address and Device Address Type
This function is used to get BLE Local Device Address and Device Address Type.
[out] | addrParam | : a pointer to local device BLE address and BLE address type. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus getBLE_GapAdDataByAdType | ( | BLE_Event_ScanReportParam * | rptData, |
BLE_GAP_AD_TYPE | parsingAdType, | ||
uint8_t * | parsingData, | ||
uint8_t * | parsingDataLen | ||
) |
Get BLE Advertising Parsing Data By Advertising Data Type
[in] | rptData | : scanned advertising data to parse. |
[in] | parsingAdType | : parsing advertising type. |
[out] | parsingData | : a pointer to the parsing data. |
[out] | parsingDataLen | : a pointer to the length of parsing data. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter which means error advertising data or there is no data of requested advertising data type. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus getBLE_Phy | ( | uint8_t | hostId | ) |
Get BLE TX/ RX PHY
[in] | hostId | : the link's host id. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus getBLE_RssiValue | ( | uint8_t | hostId | ) |
Get BLE RSSI Value
[in] | hostId | : the link's host id. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus getBLEGATT_HandleNumAddr | ( | uint8_t | hostId, |
BleGattRole | gattRole, | ||
ATTRIBUTE_BLE * | attributeElement, | ||
void * | handleNumAddr | ||
) |
Get BLE GATT Handle Numbers
[in] | hostId | : the link's host id. |
[in] | gattRole | : GATT role |
[in] | attributeElement | : a pointer to service attribute element. |
[out] | handleNumAddr | : a point to handle number table. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameters. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus getBLEGATT_MtuSize | ( | uint8_t | hostId, |
uint16_t * | mtuSize | ||
) |
Get BLE GATT MTU Size
[in] | hostId | : the link's host id. |
[out] | mtuSize | : MTU size. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus getBLEGATT_RestoreCCCDValueFromBond | ( | uint8_t | hostId | ) |
BLE GATT Get Characteristic Values from Bonded space
[in] | hostId | : the link's host id. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_AdvData | ( | uint8_t * | advData, |
uint8_t | length | ||
) |
Set BLE Advertising Data
||--------------------------------------------------------------------------------------------------------------------------------------|| || <length octets = (1+alength) octets> || || advData || ||--------------------------------------------------------------------------------------------------------------------------------------|| || <1 octet> || <alength octets = (1+slength_1)+...+(1+slength_N) octets> || ||BLE advertising data length|| BLE advertising data || ||--------------------------------------------------------------------------------------------------------------------------------------|| || || AD Structure 1 || ........ || AD Structure N || ||--------------------------------------------------------------------------------------------------------------------------------------|| || ||<1 octet>|| <slength_1 octets> || ||<1 octet>|| <slength_N octets> || || ||slength_1|| Data || ........ ||slength_N|| Data || ||--------------------------------------------------------------------------------------------------------------------------------------|| || || ||<1 octets>||<(slength_1-1) octets>|| || ||<1 octets>||<(slength_N-1) octets>|| || || || AD Type || AD Data || ........ || || AD Type || AD Data || ||--------------------------------------------------------------------------------------------------------------------------------------||
[in] | advData | : a pointer to advertising data. |
[in] | length | : length of advData. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_AdvDisable | ( | void | ) |
Set BLE Stop Advertising
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or can ONLY be set while in advertising state. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_AdvEnable | ( | uint8_t | hostId | ) |
Set BLE Start Advertising
[in] | hostId | : the link's host ID or set to BLE_HOSTID_RESERVED to enable ADV_TYPE_ADV_NONCONN_IND or ADV_TYPE_SCAN_IND advertisement. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported or only ADV_TYPE_ADV_NONCONN_IND or ADV_TYPE_SCAN_IND advertisement can be enabled. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : Invalid state usually happens in
|
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_AdvParam | ( | BLE_Adv_Param * | advParam | ) |
Set BLE Advertising Parameter
[in] | advParam | : a pointer to advertising parameter |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or can ONLY be set while the device is not in advertisement state. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_BleDeviceAddr | ( | BLE_Addr_Param * | addrParam | ) |
Set BLE Device Address and Device Address Type
This function is used to set BLE Local Device Address and Device Address Type.
[in] | addrParam | : a pointer to local device BLE address and BLE address type |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or can ONLY be set while in standby state. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
void setBLE_BleStackGpio_Isr | ( | void | ) |
Set BLE Stack Handle Interrupt ISR
This function is used to handle BLE stack interrupt.
BleStackStatus setBLE_BleStackInit | ( | void | ) |
Set BLE Stack Initialization
This function is used to initial BLE stack.
BLESTACK_STATUS_ERR_INVALID_STATE | : RF Phy has NOT initialized. |
BLESTACK_STATUS_ERR_INVALID_HOSTCOUNT | : Can ONLY be set while in standby state. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_BondingFlags | ( | BLE_BondingFlags_Param * | bondingParam | ) |
Set BLE Bonding Flags
[in] | bondingParam | : a pointer to bonding flags. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_STATE | : Invalid state usually happens in BLE stack has not initialized or BLE state is not in standby mode. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_CompanyId | ( | uint16_t | companyId | ) |
Set BLE Company ID.
[in] | companyId | : company id. |
BLESTACK_STATUS_SUCCESS | : Setting Completed. |
BleStackStatus setBLE_ConnCancel | ( | void | ) |
Set BLE Cancel the On-going Connection Procedure
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or can ONLY be set while the connection is establishing. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_ConnCreate | ( | uint8_t | hostId, |
BLE_Addr_Param * | peerAddrParam, | ||
BLE_Scan_Param * | scanParam, | ||
BLE_Conn_Param * | connParam | ||
) |
Set BLE Create Connection
[in] | hostId | : the link's host id. |
[in] | peerAddrParam | : a pointer to the target peer device address and address type. |
[in] | scanParam | : a pointer to scan parameter. |
[in] | connParam | : a pointer to connection parameter. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : Invalid state usually happens in
|
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_ConnCreateWithSetScanParam | ( | uint8_t | hostId, |
BLE_Addr_Param * | peerAddrParam, | ||
BLE_Conn_Param * | connParam | ||
) |
Set BLE Create Connection with the setting of scan parameters by setBLE_ScanParam
[in] | hostId | : the link's host id. |
[in] | peerAddrParam | : a pointer to the target peer device address and address type. |
[in] | connParam | : a pointer to connection parameter. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : Invalid state usually happens in
|
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_ConnUpdate | ( | uint8_t | hostId, |
BLE_Conn_Param * | connParam | ||
) |
BLE Update Connection Parameter
[in] | connId | : the link's Host id. |
[in] | connParam | : a pointer to connection parameter. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_ERR_TIMER_BUSY | : The connection parameter update timer is busy. Meaning there are still outstanding connection parameter update events. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_DataLength | ( | uint8_t | hostId, |
BLE_DataLength_Param * | dataLenParam | ||
) |
Set BLE Data Length Update
[in] | hostId | : the link's host id. |
[in] | dataLenParam | : a pointer to data length parameters. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_Disconnect | ( | uint8_t | hostId | ) |
Set BLE Terminate the Connection
[in] | HostId | : the link's host id. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_IOCapabilities | ( | BLE_IOCaps_Param * | ioCapsParam | ) |
Set BLE IO Capabilities
[in] | ioCapsParam | : a pointer to IO capabilities parameter. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_STATE | : Invalid state usually happens in BLE stack has not initialized or BLE state is not in standby mode. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_PairingPassKey | ( | uint8_t | hostId, |
uint32_t | hexPasskey | ||
) |
Set BLE Pairing PassKey Value
Set PassKey value to do pairing process.
[in] | hostId | : the link's host id. |
[in] | hexPasskey | : passkey for 6-digit code. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_Phy | ( | uint8_t | hostId, |
BLE_Phy_Param * | blePhy | ||
) |
Set BLE TX/ RX PHY
[in] | hostId | : the link's host id. |
[in] | blePhy | : a pointer to requested blePhy. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_ScanDisable | ( | void | ) |
Set BLE Stop Scanning
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or can ONLY be set while in scanning state. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_ScanEnable | ( | void | ) |
Set BLE Start Scanning
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or already in scanning mode. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_ScanParam | ( | BLE_Scan_Param * | scanParam | ) |
Set BLE Scanning Parameter
[in] | scanParam | : a pointer to scanning parameter. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized can ONLY be set while the device is not in scanning state. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_ScanRspData | ( | uint8_t * | scanRspData, |
uint8_t | length | ||
) |
Set BLE Scan Response Data
||----------------------------------------------------------------------------------------------------------------------------------------|| || <length octets = (1+alength) octets> || || scanRspData || ||----------------------------------------------------------------------------------------------------------------------------------------|| || <1 octet> || <alength octets = (1+slength_1)+...+(1+slength_N) octets> || ||BLE scan response data length|| BLE scan response data || ||----------------------------------------------------------------------------------------------------------------------------------------|| || || AD Structure 1 || ........ || AD Structure N || ||----------------------------------------------------------------------------------------------------------------------------------------|| || ||<1 octet>|| <slength_1 octets> || ||<1 octet>|| <slength_N octets> || || ||slength_1|| Data || ........ ||slength_N|| Data || ||----------------------------------------------------------------------------------------------------------------------------------------|| || || ||<1 octets>||<(slength_1-1) octets>|| || ||<1 octets>||<(slength_N-1) octets>|| || || || AD Type || AD Data || ........ || || AD Type || AD Data || ||----------------------------------------------------------------------------------------------------------------------------------------||
[in] | scanRspData | : a pointer to scan response data. |
[in] | length | : BLE scan response data. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_SecurityRequest | ( | uint8_t | hostId | ) |
BLE Security Request
[in] | hostId | : the link's host id. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : Invalid BLE state, usually happens in
|
BLESTACK_STATUS_ERR_TIMER_BUSY | : The Security command timer is busy. Meaning there are still unfinished security events. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLE_TxPower | ( | uint8_t | power_index, |
BleMode | bleMode | ||
) |
Set BLE TX Power
[in] | power_index | : requested TX power level in dBm, enter the index of TX power register table. The TX power register table please refer to "porting_rfpower.c". |
[in] | bleMode | : BLE mode.
|
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or in invalid BLE state for central role. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_ConfigCCCD | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
BleGattCCCDValue | cccdVal | ||
) |
BLE GATT Configure CCCD(Client Characteristic Configuration Descriptor)
[in] | hostId | : the link's host id. |
[in] | hdlNum | : cccd handle number. |
[in] | cccdVal | : CCCD value |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_SEQUENTIAL_PROTOCOL_VIOLATION | : Another GATT request already in progress please wait and retry. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_ErrorRsp | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
BleAttOpcode | opcode, | ||
BleAttErrorRsp | errRsp | ||
) |
BLE GATT Set Error Response
[in] | hostId | : the link's host id. |
[in] | hdlNum | : attribute handle in error. |
[in] | opcode | : attribute opcode in error. |
[in] | errRsp | : error code. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_ExchangeMtuRequest | ( | uint8_t | hostId, |
uint16_t | clientRxMtu | ||
) |
Set BLE Exchange MTU Request
[in] | hostId | : the link's host id. |
[in] | clientRxMtu | : client maximum receive MTU size. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_CMD | : Invalid command, usually happens in requesting the command over 1 times. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_ExecuteWrite | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
uint8_t | flag | ||
) |
BLE GATT Execute Write A Characteristic Value to A Server Data Queue (Execute Write Request)
[in] | hostId | : the link's host id. |
[in] | hdlNum | : characteristic value handle. |
[in] | flag | : 0x00: all pending prepare write values shall be discarded for this client, 0x01: writ values that were queued by the previous prepare write requests. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_SEQUENTIAL_PROTOCOL_VIOLATION | : Another GATT request already in progress please wait and retry. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_GeneralReadRsp | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
uint8_t * | data, | ||
uint16_t | length | ||
) |
BLE GATT Automatically Set Characteristic Read Response or Read By Type Response
[in] | hostId | : the link's host id. |
[in] | hdlNum | : characteristic value handle. |
[in] | data | : data to set. |
[in] | length | : the length of data. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_Indication | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
uint8_t * | data, | ||
uint16_t | length | ||
) |
BLE GATT Indicate the Attribute Value
[in] | hostId | : the link's host id. |
[in] | hdlNum | : characteristic value handle. |
[in] | data | : data to transmit. |
[in] | length | : the length of data. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_SEQUENTIAL_PROTOCOL_VIOLATION | : Another GATT request already in progress please wait and retry. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter, please check the maximum length of data. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_Notification | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
uint8_t * | data, | ||
uint16_t | length | ||
) |
BLE GATT Notify the Attribute Value
[in] | hostId | : the link's host id. |
[in] | hdlNum | : characteristic value handle. |
[in] | data | : data to transmit. |
[in] | length | : the length of data. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter, please check the maximum length of data. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_PreferredMtuSize | ( | uint8_t | hostId, |
uint16_t | preferredRxMtu | ||
) |
Set BLE Preferred MTU Size
[in] | hostId | : the link's host id. |
[in] | preferredRxMtu | : preferred Rx MTU size. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Error host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or can ONLY be set while in connection state. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_PrepareWrite | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
uint8_t * | data, | ||
uint16_t | length | ||
) |
BLE GATT Prepare Write A Characteristic Value to A Server Data Queue (Prepare Write Request)
[in] | hostId | : the link's host id. |
[in] | hdlNum | : characteristic value handle. |
[in] | data | : data to transmit (with a 16bit Value Offset at beginning). i.e. offset = 0x01, data = [0x0A,0x0B] data = [0x01,0x00,0x0A,0x0B] |
[in] | length | : the length of data (include the 16bit Value Offset, 2 byte). |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_SEQUENTIAL_PROTOCOL_VIOLATION | : Another GATT request already in progress please wait and retry. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter, please check the maximum length of data. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_ReadBlobRsp | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
uint8_t * | data, | ||
uint16_t | length | ||
) |
BLE GATT Set Characteristic Read Blob Response
[in] | hostId | : the link's host id. |
[in] | hdlNum | : characteristic value handle. |
[in] | data | : data to set. |
[in] | length | : the length of data. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_ReadByTypeRsp | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
uint8_t * | data, | ||
uint16_t | length | ||
) |
BLE GATT Set Characteristic Read By Type Response
[in] | hostId | : the link's host id. |
[in] | hdlNum | : characteristic value handle. |
[in] | data | : data to set. |
[in] | length | : the length of data. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_ReadCharacteristicValue | ( | uint8_t | hostId, |
uint16_t | hdlNum | ||
) |
BLE GATT Read Characteristic Value (Read Request)
[in] | hostId | : the link's host id. |
[in] | hdlNum | : characteristic value handle. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Invalid GATT role or no reading attribute definition, only supports for client. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_SEQUENTIAL_PROTOCOL_VIOLATION | : Another GATT request already in progress please wait and retry. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_ReadLongCharacteristicValue | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
uint16_t | Offset | ||
) |
BLE GATT Read Long Characteristic Value (Read Blob Request)
[in] | hostId | : the link's host id. |
[in] | hdlNum | : characteristic value handle. |
[in] | hdlNum | : characteristic value handle. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Invalid GATT role or no reading attribute definition, only supports for client. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_SEQUENTIAL_PROTOCOL_VIOLATION | : Another GATT request already in progress please wait and retry. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_ReadRsp | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
uint8_t * | data, | ||
uint16_t | length | ||
) |
BLE GATT Set Characteristic Read Response
[in] | hostId | : the link's host id. |
[in] | hdlNum | : characteristic value handle. |
[in] | data | : data to set. |
[in] | length | : the length of data. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_ReparseAttDatabase | ( | uint8_t | hostId | ) |
BLE Re-parse attribute database
[in] | hostId | the link's host id. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Already in Attribute database parsing process. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_Write | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
uint8_t * | data, | ||
uint16_t | length | ||
) |
BLE GATT Write A Characteristic Value to A Server (Write Request)
[in] | hostId | : the link's host id. |
[in] | hdlNum | : characteristic value handle. |
[in] | data | : data to transmit. |
[in] | length | : the length of data. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_SEQUENTIAL_PROTOCOL_VIOLATION | : Another GATT request already in progress please wait and retry. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter, please check the maximum length of data. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
BleStackStatus setBLEGATT_WriteWithoutRsp | ( | uint8_t | hostId, |
uint16_t | hdlNum, | ||
uint8_t * | data, | ||
uint16_t | length | ||
) |
BLE GATT Write A Characteristic Value to A Server (Write Without Response Request)
[in] | hostId | : the link's host id. |
[in] | hdlNum | : characteristic value handle. |
[in] | data | : data to transmit. |
[in] | length | : the length of data. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Command not supported. |
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Invalid host id. |
BLESTACK_STATUS_ERR_INVALID_STATE | : BLE stack has not initialized or there is no connection established with the host id. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : Service/ characteristic discovering or authentication/ authorization have not completed. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid handle. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter, please check the maximum length of data. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |