?? hcieventpacketproc.cpp
字號:
uint8 HCI_EventsInterfaceProcFunctions::LinkKeyNotificationEvent(CHCI_EventPacket& rHCI_EventPacket)
{
CString Temp;;
CString EventCode;
CString NumKeys;
CString BD_ADDR;
CString LinkKey;
CString ParamStr;
char buf1[15] = {'\0'},buf2[35]={'\0'},buf3[50] = {'\0'};
int ComPortNo = g_odTheBTHostApp.GetCurComPortNo();
uint8 EventIndex = rHCI_EventPacket.GetOpCode();
uint8 ParamLength= rHCI_EventPacket.GetParmLen();
sLinkKeyNotificationEvent* psLinkKeyNotification = (sLinkKeyNotificationEvent*)rHCI_EventPacket.GetHCI_EventPacketParam();
Temp.Format ("%.2X", EventIndex );
EventCode.Format ("\tEvent Code: [1] %s\n", Temp );
BT_itoa(&psLinkKeyNotification->sDevAddr ,6, buf1);
BT_ReverseStr(buf1, buf2);
Temp.Format ("%s", buf2);
BD_ADDR.Format ("\tBD_ADDR: [%d] %s\n",sizeof(psLinkKeyNotification->sDevAddr), Temp );
for(int i = 0; i < 35; i++) buf2[i] = '\0';
BT_itoa(&psLinkKeyNotification->u8LinkKey ,16, buf2);
BT_ReverseStr(buf2, buf3);
Temp.Format ("%s", buf3);
LinkKey.Format ("\tLinkKey: [%d] %s\n",sizeof(psLinkKeyNotification->u8LinkKey), Temp );
ParamStr = EventCode + BD_ADDR + LinkKey ;
g_pChildFrame->ParamListForOutput(ParamStr);
return true;
}
uint8 HCI_EventsInterfaceProcFunctions::LoopbackCommandEvent(CHCI_EventPacket& rHCI_EventPacket)/*puint8 pu8HCICommandPackets )*/
{
CString Temp;
CString EventCode;
CString HCICommand;
CString ParamStr;
char buf1[255] = {'\0'};
int ComPortNo = g_odTheBTHostApp.GetCurComPortNo();
uint8 EventIndex = rHCI_EventPacket.GetOpCode();
uint8 ParamLength= rHCI_EventPacket.GetParmLen();
sLoopbackCommandEvent* psLoopbackCommand = (sLoopbackCommandEvent*)rHCI_EventPacket.GetHCI_EventPacketParam();
Temp.Format ("%.2X", EventIndex );
EventCode.Format ("\tEvent Code: [1] %s\n", Temp );
BT_itoa(&psLoopbackCommand->pu8HCICommandPackets ,ParamLength, buf1);
Temp.Format ("%s", buf1);
HCICommand.Format ("\tHCI Command + Header: [%d] %s\n",ParamLength, Temp );
ParamStr = EventCode + HCICommand ;
g_pChildFrame->ParamListForOutput(ParamStr);
return true;
}
uint8 HCI_EventsInterfaceProcFunctions::DataBufferOverflowEvent(CHCI_EventPacket& rHCI_EventPacket)/*tLINK_TYPE tLinkType )*/
{
CString Temp, Mode;
CString EventCode;
CString LinkType;
CString ParamStr;
int ComPortNo = g_odTheBTHostApp.GetCurComPortNo();
uint8 EventIndex = rHCI_EventPacket.GetOpCode();
uint8 ParamLength= rHCI_EventPacket.GetParmLen();
sDataBufferOverflowEvent* psDataBufferOverflow = (sDataBufferOverflowEvent*)rHCI_EventPacket.GetHCI_EventPacketParam();
Temp.Format ("%.2X", EventIndex );
EventCode.Format ("\tEvent Code: [1] %s\n", Temp );
switch(psDataBufferOverflow->tLinkType)
{
case 0:
Mode = "00 SCO Buffer OverFlow"; break;
case 1:
Mode = "01 ACL Buffer OverFlow"; break;
default:
Mode = "res"; break;
}
Temp.Format ("%s", Mode);
LinkType.Format ("\tLink Type: [%d] %s\n",sizeof(psDataBufferOverflow->tLinkType), Temp );
ParamStr = EventCode + LinkType ;
g_pChildFrame->ParamListForOutput(ParamStr);
return true;
}
uint8 HCI_EventsInterfaceProcFunctions::MaxSlotsChangeEvent(CHCI_EventPacket& rHCI_EventPacket)
{
CString Temp;;
CString EventCode;
CString ConHandle;
CString LMPMaxSlots;
CString ParamStr;
char buf1[10] = {'\0'}, buf2[10] = {'\0'},buf3[5] = {'\0'};
int ComPortNo = g_odTheBTHostApp.GetCurComPortNo();
uint8 EventIndex = rHCI_EventPacket.GetOpCode();
uint8 ParamLength= rHCI_EventPacket.GetParmLen();
sMaxSlotsChangeEvent* psMaxSlotsChange = (sMaxSlotsChangeEvent*)rHCI_EventPacket.GetHCI_EventPacketParam();
Temp.Format ("%.2X", EventIndex );
EventCode.Format ("\tEvent Code: [1] %s\n", Temp );
Temp.Format ("%.4X", psMaxSlotsChange->ConnectionHandle);
ConHandle.Format ("\tConnection Handle: [%d] %s\n",sizeof(psMaxSlotsChange->ConnectionHandle), Temp );
BT_itoa(&psMaxSlotsChange->LMP_MaxSlots ,1, buf3);
Temp.Format ("%s", buf3);
LMPMaxSlots.Format ("\tLMP_MAX_SLots: [%d] %s\n",sizeof(psMaxSlotsChange->LMP_MaxSlots), Temp );
ParamStr = EventCode + ConHandle + LMPMaxSlots ;
g_pChildFrame->ParamListForOutput(ParamStr);
return true;
}
uint8 HCI_EventsInterfaceProcFunctions::ReadClockOffsetCompleteEvent(CHCI_EventPacket& rHCI_EventPacket)
{
CString Temp; int n;
CString EventCode;
CString Status;
CString ConHandle;
CString ClockOffset;
CString ParamStr;
char buf1[10] = {'\0'},buf2[10] = {'\0'},buf3[10] = {'\0'};
char ErrorDef[40] = {'\0'};
int ComPortNo = g_odTheBTHostApp.GetCurComPortNo();
uint8 EventIndex = rHCI_EventPacket.GetOpCode();
uint8 ParamLength= rHCI_EventPacket.GetParmLen();
sReadClockOffsetCompleteEvent* psReadClockOffset = (sReadClockOffsetCompleteEvent*)rHCI_EventPacket.GetHCI_EventPacketParam();
Temp.Format ("%.2X", EventIndex );
EventCode.Format ("\tEvent Code: [1] %s\n", Temp );
if(psReadClockOffset->Status) {
g_pChildFrame->ErrorDef((char *)(&psReadClockOffset->Status), ErrorDef);
Temp.Format ("%.2X - %s", psReadClockOffset->Status, ErrorDef);
}else
Temp.Format ("%.2X",psReadClockOffset->Status);
BT_itoa(&psReadClockOffset->Status ,1, buf1);
Temp.Format ("%s", buf1);
Status.Format ("\tStatus: [%d] %s\n",sizeof(psReadClockOffset->Status), Temp );
Temp.Format ("%-.4X", psReadClockOffset->ConnectionHandle); n = Temp.GetLength();
ConHandle.Format ("\tConnectionHandle: [%d] %s\n",sizeof(psReadClockOffset->ConnectionHandle), Temp );
Temp.Format ("%.4X", psReadClockOffset->tClockOffset); n = Temp.GetLength();
ClockOffset.Format ("\tClock Offset: [%d] %s\n",sizeof(psReadClockOffset->tClockOffset), Temp );
ParamStr = EventCode + Status + ConHandle + ClockOffset ;
g_pChildFrame->ParamListForOutput(ParamStr);
return true;
}
uint8 HCI_EventsInterfaceProcFunctions::ChangeConnectionPacketTypeEvent(CHCI_EventPacket& rHCI_EventPacket)
{
CString Temp; int n;
CString EventCode;
CString Status;
CString ConHandle;
CString PacketType;
CString ParamStr;
char buf1[10] = {'\0'},buf2[10] = {'\0'},buf3[10] = {'\0'};
char ErrorDef[40] = {'\0'};
int ComPortNo = g_odTheBTHostApp.GetCurComPortNo();
uint8 EventIndex = rHCI_EventPacket.GetOpCode();
uint8 ParamLength= rHCI_EventPacket.GetParmLen();
sChangeConnectionPacketTypeEvent* psChangeConnectionType = (sChangeConnectionPacketTypeEvent*)rHCI_EventPacket.GetHCI_EventPacketParam();
Temp.Format ("%.2X", EventIndex );
EventCode.Format ("\tEvent Code: [1] %s\n", Temp );
if(psChangeConnectionType->Status) {
g_pChildFrame->ErrorDef((char *)(&psChangeConnectionType->Status), ErrorDef);
Temp.Format ("%.2X - %s", psChangeConnectionType->Status, ErrorDef);
}else
Temp.Format ("%.2X",psChangeConnectionType->Status);
Status.Format ("\tStatus: [%d] %s\n",sizeof(psChangeConnectionType->Status), Temp );
Temp.Format ("%-.4X", psChangeConnectionType->ConnectionHandle); n = Temp.GetLength();
ConHandle.Format ("\tConnectionHandle: [%d] %s\n",sizeof(psChangeConnectionType->ConnectionHandle), Temp );
Temp.Format ("%-.4X", (uint16)psChangeConnectionType->tPacketType); n = Temp.GetLength();
PacketType.Format ("\tPacket Type: [%d] %s\n",sizeof(psChangeConnectionType->tPacketType), Temp );
ParamStr = EventCode + Status + ConHandle + PacketType ;
g_pChildFrame->ParamListForOutput(ParamStr);
return true;
}
uint8 HCI_EventsInterfaceProcFunctions::QosViolationEvent(CHCI_EventPacket& rHCI_EventPacket)
{
CString Temp; int n;
CString EventCode;
CString Status;
CString ConHandle;
CString ParamStr;
char buf2[10] = {'\0'};
int ComPortNo = g_odTheBTHostApp.GetCurComPortNo();
uint8 EventIndex = rHCI_EventPacket.GetOpCode();
uint8 ParamLength= rHCI_EventPacket.GetParmLen();
sQosViolationEvent* psQosViolation = (sQosViolationEvent*)rHCI_EventPacket.GetHCI_EventPacketParam();
Temp.Format ("%.2X", EventIndex );
EventCode.Format ("\tEvent Code: [1] %s\n", Temp );
Temp.Format ("%-.4X", psQosViolation->ConnectionHandle); n = Temp.GetLength();
ConHandle.Format ("\tConnectionHandle: [%d] %s\n",sizeof(psQosViolation->ConnectionHandle), Temp );
ParamStr = EventCode + ConHandle ;
g_pChildFrame->ParamListForOutput(ParamStr);
return true;
}
uint8 HCI_EventsInterfaceProcFunctions::PageScanModeChangeEvent(CHCI_EventPacket& rHCI_EventPacket)
{
CString Temp; int n;
CString EventCode;
CString PageScanMode;
CString BD_ADDR;
CString ParamStr, str;
char buf1[15] = {'\0'},buf2[20] = {'\0'};
int ComPortNo = g_odTheBTHostApp.GetCurComPortNo();
uint8 EventIndex = rHCI_EventPacket.GetOpCode();
uint8 ParamLength= rHCI_EventPacket.GetParmLen();
sPageScanModeChangeEvent* psPageScanModeChange = (sPageScanModeChangeEvent*)rHCI_EventPacket.GetHCI_EventPacketParam();
Temp.Format ("%.2X", EventIndex );
EventCode.Format ("\tEvent Code: [1] %s\n", Temp );
BT_itoa(&psPageScanModeChange->sDevAddr ,6, buf1);
BT_ReverseStr(buf1, buf2);
Temp.Format ("%s", buf2);
BD_ADDR.Format ("\tBD_ADDR: [%d] %s\n",sizeof(psPageScanModeChange->sDevAddr), Temp );
BT_itoa(&psPageScanModeChange->atPageScanMode ,1, buf2);
Temp.Format ("%s", buf2); n = Temp.GetLength();
PageScanMode.Format ("\tPage scan Mode: [%d] %s\n",sizeof(psPageScanModeChange->atPageScanMode), Temp );
ParamStr =EventCode + BD_ADDR + PageScanMode;
g_pChildFrame->ParamListForOutput(ParamStr);
return true;
}
uint8 HCI_EventsInterfaceProcFunctions::PageScanRepeatationModeChangeEvent(CHCI_EventPacket& rHCI_EventPacket)
{
return true;
}
//
// Tracer debug information need to be decipher based on Telencomm Event
// Following format should be applied based on TelenComm Event Byte
// Event 00: Data is the result of printf and should be displayed in ASCII format
// 01: Data need to be brake out into following format:
// typedef struct {
// uint16 Id; //Should be Displayed in HEX
// uint32 TimeStamp; //Should be Displayed in HEX
// char Text[TS_LOGM_TEXT_MAX_SIZE]; //Should be Displayed in ASCII ,Fixed Len
// uint8 Data[TS_LOGM_MAX_DATA_SIZE]; //Should be Displayed in HEX ,Variable Len
// *pText; //Not Used
// uint8 DataLen;
// }
//
uint8 HCI_EventsInterfaceProcFunctions::DebugInformationEvent(CHCI_EventPacket& rHCI_EventPacket)
{
typedef struct {
uint16 Id;
uint32 TimeStamp;
char Text[TS_LOGM_TEXT_MAX_SIZE]; //Fixed Len
uint8 Data[TS_LOGM_MAX_DATA_SIZE]; //Variable Len
} tTS_MonitorCtrlDataClock;
int DataLen, n, i, j;
uint16 Id;
uint32 TimeStamp, secMult;
__int64 TimeStampUSec;
int hours, mins, secs, msecs,usecs;
// int hRem, mRem, sRem,msRem;
char TextStr[2 * TS_LOGM_TEXT_MAX_SIZE + 1];
char DataStr[4 * TS_LOGM_MAX_DATA_SIZE + 1];
char buf1[500] = {'\0'},buf3[100] = {'\0'};
CString IdStr;
CString TimeStampStr;
CString Temp;
CString strText;
CString EventCode;
CString TelenCommEvent;
CString DebMessage;
CString ParamStr;
CString MSecStr;
tTS_MonitorCtrlDataClock* TS_MonCtrl;
sDebugInformationEvent* psDebInfoParams;
//psDebInfoParams = (psRetParams_tag*)rHCI_EventPacket.GetHCI_EventPacketParam();
psDebInfoParams = (sDebugInformationEvent*)rHCI_EventPacket.GetHCI_EventPacketParam();
int ComPortNo = g_odTheBTHostApp.GetCurComPortNo();
uint8 EventIndex = rHCI_EventPacket.GetOpCode();
uint8 ParamLength= rHCI_EventPacket.GetParmLen();
Temp.Format ("%.2X", EventIndex );
EventCode.Format ("\tEvent Code: [1] %s\r\n", Temp );
Temp.Empty();
Temp.Format ("%.2X", psDebInfoParams->TelenCommEvent); n = Temp.GetLength();
TelenCommEvent.Format("\tTelenCommEvent:
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -