123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- #ifndef _DRV_IPC_H_
- #define _DRV_IPC_H_
- #include <stdio.h>
- #include "btreg.h"
- #include "type.h"
- #define LE_ADV_DATA_MAX_LENGTH 31
- #define LE_SCAN_RSP_MAX_LENGTH 31
- #define Adv_Type_Flags 0x01
- #define Adv_Type_CompleteLocalName 0x09
- typedef enum
- {
- BR_STATE_INVALID,
- BR_IDLE,
- BR_CONNECTABLE,
- BR_DISCOVERABLE,
- BR_CONNECTABLE_DISCOVERABLE,
- BR_CONNECTING,
- BR_CONNECTED,
- BR_HFP_INCOMMING,
- BR_HFP_OUTGOING,
- BR_HFP_CALLACTIVE,
- BR_HFP_CALLACTIVE_WITHOUT_SCO,
- BR_HFP_CALLIMG,
- BR_HFP_CALLOGG,
- BR_HFP_CALMULTY,
- BR_STATE_NUM,
- }BR_STATE_TYPE;
- typedef enum{
- NONE_FILTER,
- WHITE_LIST_SCAN_FILTER,
- WHITE_LIST_CONNECT_FILTER,
- WHITE_LIST_FILTER,
- WHITE_LIST_CONN_SCAN_FILTER,
- }LE_WHITE_POLICY;
- typedef struct
- {
- uint8_t topState;
- uint8_t secondState;
- uint8_t thirdlyState;
- }BR_STATE;
- typedef enum
- {
- BLE_STATE_INVALID,
- BLE_IDLE,
- BLE_ADV,
- BLE_CONNECTING,
- BLE_CONNECTED,
- BLE_PAIRED,
- BLE_FAST_PAIRED,
- BLE_DIRECT_ADV,
- }BLE_STATE_TYPE;
- typedef enum {
- ADV_TYPE_NOMAL,
- ADV_TYPE_DIRECT,
- ADV_TYPE_NOCONNECT,
- SCAN_REQ,
- SCAN_RSP,
- CONNECT_REQ,
- ADV_TYPE_SCAN,
- }advType;
- typedef enum
- {
- ADV_DISABLE=0x00,
- ADV_ENABLE=0x01,
- }ADV_STATE;
- typedef enum {
- SCAN_TYPE_PASSIVE,
- SCAN_TYPE_ACTIVE,
- }scanType;
- typedef struct
- {
- uint8_t topState;
- uint8_t secondState;
- }BLE_STATE;
- typedef struct
- {
- uint16_t min_interval;
- uint16_t max_interval;
- uint16_t latency;
- uint16_t timeout;
- }BLE_Conn_param;
- void Ble_SendBleData(uint16_t BLE_WRITE_HANDLE,uint8_t* data, uint16_t len);
- void Bt_SetBleAddr(unsigned char* pAddr);
- void Bt_SetSppAddr(unsigned char* pAddr);
- void Bt_SetSppName(unsigned char* Name,int Len);
- void Bt_Re_BleAdvName(uint8_t *name,uint8_t len);
- void Bt_Re_BleDeivcename(uint8_t *name,uint8_t len);
- void Bt_Renew_Adv_Data(uint8_t *data,uint8_t len);
- void Bt_Renew_Scan_Rsp(uint8_t *data,uint8_t len);
- void Bt_SetAdvType(advType Type);
- void Bt_SetScanRspType(scanType Type);
- void Update_connection_param(BLE_Conn_param* param);
- void Bt_SetAdvInterval(uint16_t gap);
- void Bt_StartAdv(int time_10ms,uint16_t gap);
- void Bt_StartDirectAdv(int time_10ms, uint16_t gap);
- void Bt_send_stop_direct_adv(int params);
- void Bt_stop_adv(int params);
- void Bt_setBLEState(uint8_t inState);
- void Bt_EvtCallBack(uint8_t len,uint8_t *dataPtr);
- void Bt_BleCallBack(uint8_t len,uint8_t *dataPtr);
- uint8_t Bt_checkBleIsConnected();
- uint8_t Bt_checkBleIsAdvStart();
- void Bt_Reset();
- BLE_STATE_TYPE Bt_getBLEState();
- #endif //_DRV_IPC_H_
|