📄 hcibasecmdproc.h
字号:
//--------------------------------------------------------------- %FILH_BEG% --
//
// Project: $$ProjectName
//
// File name: HCIBaseCmdProc.h
//
// Author:
// Description:
//
// Revision History:
// $Log: $
//
// Rev 1.01 12/11/00 EK .Added eTESTING_CMD to the list of HCi Command type "eHCICmdType"
// Rev 1.00 15 July 2000 Initial release
//
//
// Copyright (c) TelenComm Corporation 2000 - All rights reserved
//--------------------------------------------------------------- %FILH_END% --
#ifndef HCI_BASE_CMD_H
#define HCI_BASE_CMD_H
//------------------------------------------------------------------------------
//
// Includes
//
//------------------------------------------------------------------------------
#include "..\..\Common\Common.h"
//------------------------------------------------------------------------------
//
// Macros
//
//------------------------------------------------------------------------------
//#define RET_PARM_FUNC2( Func,RetParamProcFunction) #Func#RetParamProcFunction
//#define RET_PARM_FUNC( Func) RET_PARM_FUNC2( Func,RetParamProcFunction)
#define HCI_COMMAND_TABLE_ITEM(OGF, OCF, SpecSection, Function, ParameterLength,RetFunc) {MAKE_OPCODE(OGF, OCF), OGF, OCF, ParameterLength, Function, #SpecSection, #Function,RetFunc},
//,RET_PARM_FUNC( Function)},
#define NO_PAR (0xFFFF)
#define NO_OF_BITS_IN_OCF 10
#define NO_OF_BITS_IN_OGF 6
#define OCF_MASK 0x3FF
#define MAKE_OPCODE(OGF, OCF) ((OGF << NO_OF_BITS_IN_OCF ) + OCF)
#define GET_OGF(OPCODE) (OPCODE >> NO_OF_BITS_IN_OCF)
#define GET_OCF(OPCODE) (OPCODE & OCF_MASK)
#define SIZE_OF_ONE_PARM(a) sizeof(a)
#define SIZE_OF_TWO_PARM(a,b) (sizeof(a) + sizeof(b))
#define SIZE_OF_THREE_PARM(a,b,c) (sizeof(a) + sizeof(b) + sizeof(c))
#define SIZE_OF_FOUR_PARM(a,b,c,d) (sizeof(a) + sizeof(b) + sizeof(c))
#define SIZE_OF_FIVE_PARM(a,b,c,d,e) (sizeof(a) + sizeof(b) + sizeof(c) + sizeof(d) + sizeof(e))
#define SIZE_OF_SIX_PARM(a,b,c,d,e,f) (sizeof(a) + sizeof(b) + sizeof(c) + sizeof(d) + sizeof(e) + sizeof(f))
//------------------------------------------------------------------------------
//
// Types
//
//------------------------------------------------------------------------------
typedef uint16 tHCICommandOpCode;
typedef uint8 tHCICommandOGF;
typedef uint16 tHCICommandOCF;
typedef uint8 tHCICommandParameter;
typedef uint8 tHCICommandParameterLength;
typedef char* tHCICommandSpecSection;
typedef char* tHCICommandName;
typedef uint16 tClock_Offset;
typedef uint8 tAllowRoleSwitch;
typedef uint8 tReason;
typedef uint16 tAddrOffset;
typedef uint32 tData32;
typedef uint16 tMask;
typedef uint32 tMask32;
typedef char* tLinkKey;
class CHCI_CmdPacket;
//------------------------------------------------------------------------------
//
// Declarations
//
//------------------------------------------------------------------------------
class CHCIBaseCmdProcessor
{
public:
CHCIBaseCmdProcessor(){}
enum eHCICmdType { eFIRST_CMD_TYPE=1, eLC_CMD=eFIRST_CMD_TYPE,eLP_CMD, eLC_BB_CMD,eINFO_PARM_CMD,eSTS_PARM_CMD,eTESTING_CMD,eVEND_SPEC_CMD,eLAST_CMD_TYPE = eVEND_SPEC_CMD};
//EK enum eHCICmdType { eFIRST_CMD_TYPE=1, eLC_CMD=eFIRST_CMD_TYPE,eLP_CMD,eLC_BB_CMD,eINFO_PARM_CMD,eSTS_PARM_CMD,eTESTING_CMD,eLAST_CMD_TYPE = eTESTING_CMD };
typedef uint8 (*tHCICommandFunction)(CHCI_CmdPacket& HCI_CmdPacket);
typedef uint8 (*tCmdRetParamFunction)(char* pRetParams);
enum tCmdParseStatus { ePARSING_OK, ePARAMETER_SIZE_MISMATCH,eUNKNOWN_CMD};
struct tHCICommandTableItem
{
tHCICommandOpCode OpCode;
tHCICommandOGF OpCodeGroupField;
tHCICommandOCF OpCodeCommandField;
tHCICommandParameterLength ParameterTotalLength;
tHCICommandFunction CommandFunction;
#ifdef BT_DEBUG
tHCICommandSpecSection SpecSection;
tHCICommandName Name;
#endif
tCmdRetParamFunction CmdRetParamFunction;
};
virtual tCmdParseStatus ParseHCICmdType(CHCI_CmdPacket& HCI_CmdPacket) = 0;
};
#endif HCI_BASE_CMD_H
//------------------------------------------------------------------------------
// End of HCIBaseCmdProc.h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -