bt_mt_meta.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:3k
- #ifndef _BT_MT_META_H_
- #define _BT_MT_META_H_
- //=============================================================================
- // common
- #ifndef META_DLL_H
- #include "meta.h"
- #endif
- #ifndef _MAN_HANDLE_H_
- #include "man_handle.h"
- #endif
- #ifndef _METAAPP_COMMON_H_
- #include "metaapp_common.h"
- #endif
- // BT
- #ifndef _BT_MT_COMMON_H_
- #include "bt_mt_common.h"
- #endif
- typedef struct
- {
- E_BT_DEVICE_T e_bt_device;
- E_BT_TRANS_T e_bt_trans[2];
- BT_HCI_COMMAND s_hci_cmd;
- int i_event_num;
- BT_HCI_EVENT s_hci_event[MAX_EVENT_NUM];
- int i_auto_event_num;
- BT_HCI_EVENT s_hci_auto_event[MAX_EVENT_NUM];
- }BT_META_HCI_T;
- typedef struct
- {
- E_BT_DEVICE_T e_bt_device;
- E_BT_TRANS_T e_bt_trans[2];
- //BT_HCI_COMMAND s_hci_cmd;
- BT_HCI_BUFFER s_tx_acl_data;
- BT_HCI_BUFFER s_rx_acl_data;
- int i_event_num;
- BT_HCI_EVENT s_hci_event[MAX_EVENT_NUM];
- }BT_META_ACL_DATA_T;
- //-----------------------------------------------
- class CBTMTMETA
- {
- private:
- bool m_bEventOk;
- bool m_bAclDataOk;
- CMETAHANDLE m_META_HANDLE_Obj;
- //unsigned char m_ucEventBuf[HCIEVENTBUFSIZE]; // binary format
- //int m_iEventLen;
- //int m_iEventType;
- int m_iEventIdx;
- int m_iAutoEventIdx;
- BT_META_HCI_T m_sHciCmd;
- bool m_bRegAutoCallback[2];
- bool m_bCallAutoCallback[2];
- BT_META_ACL_DATA_T m_sTxAclData;
- BT_META_ACL_DATA_T m_sRxAclData;
- bool m_bRegAclRxCallback[2];
- bool m_bCallAclRxCallback[2];
- protected:
- void ConsumeErrorEvent(void);
- //public:
- public:
- CBTMTMETA(void);
- CBTMTMETA(int port_no, int ena_flowctrl);
- bool RegAutoCallBack0(void);
- bool SendCommand(BT_META_HCI_T cmd);
- bool RegAclRxData0(void);
- bool SendAclData(BT_META_ACL_DATA_T acl_data);
- // call back
- void __stdcall CNF_AutoHCIEvent0(const BT_HCI_EVENT *cnf, const short token, void *usrData);
- void __stdcall CNF_AutoHCIEvent1(const BT_HCI_EVENT *cnf, const short token, void *usrData);
- void __stdcall CNF_HCIEvent0(const BT_HCI_EVENT *cnf, const short token, void *usrData);
- void __stdcall CNF_HCIEvent1(const BT_HCI_EVENT *cnf, const short token, void *usrData);
- void __stdcall CNF_RxAclCallback0(const BT_HCI_BUFFER *cnf, const short token, void *usrData);
- void __stdcall CNF_RxAclCallback1(const BT_HCI_BUFFER *cnf, const short token, void *usrData);
- void __stdcall CNF_TxAclCallback0(const BT_HCI_PACKET *cnf, const short token, void *usrData);
- void __stdcall CNF_TxAclCallback1(const BT_HCI_PACKET *cnf, const short token, void *usrData);
- // export information
- bool Get_EventOk(void);
- bool Get_CallAutoCallback(int idx);
- void Set_HciCmd(BT_META_HCI_T cmd);
- };
- //=============================================================================
- #endif