//分配内存,应用程序不应该调用这个函数.
void *HCI_bm_alloc( uint16 size );
//检查连接时间参数和连接时间参数的组合是否有效
uint8 HCI_ValidConnTimeParams( uint16 connIntervalMin,
uint16 connIntervalMax,
uint16 connLatency,
uint16 connTimeout );
//HCI vendor specific registration for HCI Test Application
void HCI_TestAppTaskRegister( uint8 taskID );
// HCI vendor specific registration for Host GAP.
void HCI_GAPTaskRegister( uint8 taskID );
//HCI vendor specific registration for Host L2CAP.
void HCI_L2CAPTaskRegister( uint8 taskID );
//HCI vendor specific registration for Host SMP.
void HCI_SMPTaskRegister( uint8 taskID );
// HCI vendor specific registration for Host extended commands.
void HCI_ExtTaskRegister( uint8 taskID );
//发送一个ACL数据包
hciStatus_t HCI_SendDataPkt( uint16 connHandle,
uint8 pbFlag,
uint16 pktLen,
uint8 *pData );
//中断连接
hciStatus_t HCI_DisconnectCmd( uint16 connHandle,
uint8 reason );
//请求得到版本信息
hciStatus_t HCI_ReadRemoteVersionInfoCmd( uint16 connHandle );
//设置消息蒙版,确定支持哪些消息
hciStatus_t HCI_SetEventMaskCmd( uint8 *pMask );
//重置连接层
hciStatus_t HCI_ResetCmd( void );
//读取发射功率
hciStatus_t HCI_ReadTransmitPowerLevelCmd( uint16 connHandle,
uint8 txPwrType );
//主机用来开关流量控制(控制器法向主机的)
hciStatus_t HCI_SetControllerToHostFlowCtrlCmd( uint8 flowControlEnable );
//This BT API is used by the Host to notify the Controller of the maximum size ACL buffer size the Controller can send to the Host.
hciStatus_t HCI_HostBufferSizeCmd( uint16 hostAclPktLen,
uint8 hostSyncPktLen,
uint16 hostTotalNumAclPkts,
uint16 hostTotalNumSyncPkts );
//This BT API is used by the Host to notify the Controller of the number of HCI data packets that have been completed for each connection handle since this command was previously sent to the controller.
hciStatus_t HCI_HostNumCompletedPktCmd( uint8 numHandles,
uint16 *connHandles,
uint16 *numCompletedPkts );
//读取本地版本信息
hciStatus_t HCI_ReadLocalVersionInfoCmd( void );
//读取本地支持的命令
hciStatus_t HCI_ReadLocalSupportedCommandsCmd( void );
//读取本地支持的特性
hciStatus_t HCI_ReadLocalSupportedFeaturesCmd( void );
//读取设备的BLE地址
hciStatus_t HCI_ReadBDADDRCmd( void );
//读取最后一个包的RSSI
hciStatus_t HCI_ReadRssiCmd( uint16 connHandle );
//设置HCI LE时间蒙版,确定支持哪些事件
hciStatus_t HCI_LE_SetEventMaskCmd( uint8 *pEventMask );
//取得最大ACL数据包大小
hciStatus_t HCI_LE_ReadBufSizeCmd( void );
//取得本地支持的特性
hciStatus_t HCI_LE_ReadLocalSupportedFeaturesCmd( void );
//设置设别随机地址
hciStatus_t HCI_LE_SetRandomAddressCmd( uint8 *pRandAddr );
//设置广播参数
hciStatus_t HCI_LE_SetAdvParamCmd( uint16 advIntervalMin,
uint16 advIntervalMax,
uint8 advType,
uint8 ownAddrType,
uint8 directAddrType,
uint8 *directAddr,
uint8 advChannelMap,
uint8 advFilterPolicy );
//设置广播数据
hciStatus_t HCI_LE_SetAdvDataCmd( uint8 dataLen,
uint8 *pData );
//设置广播搜索响应数据
hciStatus_t HCI_LE_SetScanRspDataCmd( uint8 dataLen,
uint8 *pData );
//开关广播
hciStatus_t HCI_LE_SetAdvEnableCmd( uint8 advEnable );
//读取广播时的发射功率
hciStatus_t HCI_LE_ReadAdvChanTxPowerCmd( void );
//设置搜索参数
hciStatus_t HCI_LE_SetScanParamCmd( uint8 scanType,
uint16 scanInterval,
uint16 scanWindow,
uint8 ownAddrType,
uint8 filterPolicy );
//开关搜索
hciStatus_t HCI_LE_SetScanEnableCmd( uint8 scanEnable,
uint8 filterDuplicates );
//建立连接
hciStatus_t HCI_LE_CreateConnCmd( uint16 scanInterval,
uint16 scanWindow,
uint8 initFilterPolicy,
uint8 addrTypePeer,
uint8 *peerAddr,
uint8 ownAddrType,
uint16 connIntervalMin,
uint16 connIntervalMax,
uint16 connLatency,
uint16 connTimeout,
uint16 minLen,
uint16 maxLen );
//取消创建连接
hciStatus_t HCI_LE_CreateConnCancelCmd( void );
//读取白名单
hciStatus_t HCI_LE_ReadWhiteListSizeCmd( void );
//清除白名单
hciStatus_t HCI_LE_ClearWhiteListCmd( void );
//添加一条白名单
hciStatus_t HCI_LE_AddWhiteListCmd( uint8 addrType,
uint8 *devAddr );
//移除一条白名单
hciStatus_t HCI_LE_RemoveWhiteListCmd( uint8 addrType,
uint8 *devAddr );
//更新连接参数
hciStatus_t HCI_LE_ConnUpdateCmd( uint16 connHandle,
uint16 connIntervalMin,
uint16 connIntervalMax,
uint16 connLatency,
uint16 connTimeout,
uint16 minLen,
uint16 maxLen );
//更新当前数据通道MAP
hciStatus_t HCI_LE_SetHostChanClassificationCmd( uint8 *chanMap );
//读取连接数据通道MAP
hciStatus_t HCI_LE_ReadChannelMapCmd( uint16 connHandle );
//读取远程设备用户特性
hciStatus_t HCI_LE_ReadRemoteUsedFeaturesCmd( uint16 connHandle );
//执行AES128加密
hciStatus_t HCI_LE_EncryptCmd( uint8 *key,
uint8 *plainText );
//产生随机数
hciStatus_t HCI_LE_RandCmd( void );
//连接中开始加密
hciStatus_t HCI_LE_StartEncyptCmd( uint16 connHandle,
uint8 *random,
uint8 *encDiv,
uint8 *ltk );
//主机向控制器发送一个LTK回应
hciStatus_t HCI_LE_LtkReqReplyCmd( uint16 connHandle,
uint8 *ltk );
//This LE API is used by the Host to send to the Controller a negative LTK reply.
hciStatus_t HCI_LE_LtkReqNegReplyCmd( uint16 connHandle );
//读取控制器支持的状态
hciStatus_t HCI_LE_ReadSupportedStatesCmd( void );
// This LE API is used to start the receiver Direct Test Mode test.
hciStatus_t HCI_LE_ReceiverTestCmd( uint8 rxFreq );
//This LE API is used to start the transmit Direct Test Mode test.
hciStatus_t HCI_LE_TransmitterTestCmd( uint8 txFreq,
uint8 dataLen,
uint8 pktPayload );
//This LE API is used to end the Direct Test Mode test.
hciStatus_t HCI_LE_TestEndCmd( void );
//This HCI Extension API is used to set the receiver gain.
hciStatus_t HCI_EXT_SetRxGainCmd( uint8 rxGain );
//设置发射功率
hciStatus_t HCI_EXT_SetTxPowerCmd( uint8 txPower );
//设置是否连接中一个消息只能包含一个包
hciStatus_t HCI_EXT_OnePktPerEvtCmd( uint8 control );
//This HCI Extension API is used to set whether the system clock will be divided when the MCU is halted.
hciStatus_t HCI_EXT_ClkDivOnHaltCmd( uint8 control );
//This HCI Extension API is used to indicate to the Controller whether or not the Host will be using the NV memory during BLE operations.
hciStatus_t HCI_EXT_DeclareNvUsageCmd( uint8 mode );
//使用AES128解密
hciStatus_t HCI_EXT_DecryptCmd( uint8 *key,
uint8 *encText );
//设置支持的特性
hciStatus_t HCI_EXT_SetLocalSupportedFeaturesCmd( uint8 *localFeatures );
//设置尽快发送数据
hciStatus_t HCI_EXT_SetFastTxResponseTimeCmd( uint8 control );
//This HCI Extension API is used to to enable or disable suspending slave latency.
hciStatus_t HCI_EXT_SetSlaveLatencyOverrideCmd( uint8 control );
//This API is used start a continuous transmitter modem test, using either a modulated or unmodulated carrier wave tone, at the frequency that corresponds to the specified RF channel. Use HCI_EXT_EndModemTest command to end the test.
hciStatus_t HCI_EXT_ModemTestTxCmd( uint8 cwMode,
uint8 txFreq );
//This API is used to start a continuous transmitter direct test mode test using a modulated carrier wave and transmitting a 37 byte packet of Pseudo-Random 9-bit data. A packet is transmitted on a different frequency (linearly stepping through all RF channels 0..39) every 625us. Use HCI_EXT_EndModemTest command to end the test.
hciStatus_t HCI_EXT_ModemHopTestTxCmd( void );
//This API is used to start a continuous receiver modem test using a modulated carrier wave tone, at the frequency that corresponds to the specific RF channel. Any received data is discarded. Receiver gain may be adjusted using the HCI_EXT_SetRxGain command. RSSI may be read during this test by using the HCI_ReadRssi command. Use HCI_EXT_EndModemTest command to end the test.
hciStatus_t HCI_EXT_ModemTestRxCmd( uint8 rxFreq );
//This API is used to shutdown a modem test. A complete Controller reset will take place.
hciStatus_t HCI_EXT_EndModemTestCmd( void );
//设置设备的BLE地址
hciStatus_t HCI_EXT_SetBDADDRCmd( uint8 *bdAddr );
//设置设备的睡眠时钟精度
hciStatus_t HCI_EXT_SetSCACmd( uint16 scaInPPM );
//This HCI Extension API is used to enable Production Test Mode.
hciStatus_t HCI_EXT_EnablePTMCmd( void );
//This HCI Extension API is used to set the frequency tuning up or down. Setting the mode up/down decreases/increases the amount of capacitance on the external crystal oscillator.
hciStatus_t HCI_EXT_SetFreqTuneCmd( uint8 step );
//保存频率调谐值到Flash
hciStatus_t HCI_EXT_SaveFreqTuneCmd( void );
//This HCI Extension API is used to set the maximum transmit output power for Direct Test Mode.
hciStatus_t HCI_EXT_SetMaxDtmTxPowerCmd( uint8 txPower );
llStatus_t HCI_EXT_MapPmIoPortCmd( uint8 ioPort, uint8 ioPin );
//立即断开连接
hciStatus_t HCI_EXT_DisconnectImmedCmd( uint16 connHandle );
//读取或复位包错误率计数器
hciStatus_t HCI_EXT_PacketErrorRateCmd( uint16 connHandle, uint8 command );
//开始或结束包错误率计数
hciStatus_t HCI_EXT_PERbyChanCmd( uint16 connHandle, perByChan_t *perByChan );
//This HCI Extension API is used to Extend Rf Range using the TI CC2590 2.4 GHz RF Front End device
hciStatus_t HCI_EXT_ExtendRfRangeCmd( void );
//This HCI Extension API is used to enable or disable halting the CPU during RF. The system defaults to enabled.
hciStatus_t HCI_EXT_HaltDuringRfCmd( uint8 mode );
//This HCI Extension API is used to enable or disable a notification to the specified task using the specified task event whenever a Adv event ends. A non-zero taskEvent value is taken to be "enable", while a zero valued taskEvent is taken to be "disable".
hciStatus_t HCI_EXT_AdvEventNoticeCmd( uint8 taskID, uint16 taskEvent );
//This HCI Extension API is used to enable or disable a notification to the specified task using the specified task event whenever a Connection event ends. A non-zero taskEvent value is taken to be "enable", while a zero valued taskEvent taken to be "disable".
hciStatus_t HCI_EXT_ConnEventNoticeCmd( uint8 taskID, uint16 taskEvent );
//设置用户版本号
hciStatus_t HCI_EXT_BuildRevisionCmd( uint8 mode, uint16 userRevNum );