📄 lssu.cpp
字号:
// Lssu.cpp: implementation of the CLssu class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "decode.h"
#include "Lssu.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CLssu::CLssu()
{
this->createLssuTypeTable();
this->create_lssuSFTable();
}
CLssu::~CLssu()
{
}
void CLssu::createLssuTypeTable()
{
int i;
for(i=0; i<8; i++)
{
strcpy(m_lssuTypeTable[i], "Reserved");
}
strcpy(m_lssuTypeTable[0], "SIO");
strcpy(m_lssuTypeTable[1], "SIN");
strcpy(m_lssuTypeTable[2], "SIE");
strcpy(m_lssuTypeTable[3], "SIOS");
strcpy(m_lssuTypeTable[4], "SIPO");
strcpy(m_lssuTypeTable[5], "SIB");
}
void CLssu::create_lssuSFTable()
{
int i;
for(i=0; i<8; i++)
{
strcpy(m_lssuSFTable[i], "Reserved");
}
strcpy(m_lssuSFTable[0], "SIO:失去定位");
strcpy(m_lssuSFTable[1], "SIN:正常定位");
strcpy(m_lssuSFTable[2], "SIE:紧急定位");
strcpy(m_lssuSFTable[3], "SIOS:故障");
strcpy(m_lssuSFTable[4], "SIPO:处理机故障");
strcpy(m_lssuSFTable[5], "SIB:忙");
}
BOOL CLssu::GetData(BYTE *u_pMsg, DWORD u_msgLength, char *v_pData)
{
BYTE lssuType;
lssuType = u_pMsg[SS7_LSSU_SF_OFFSET] & SS7_LSSU_SF_MASK;
sprintf(v_pData, "LSSU %s", m_lssuTypeTable[lssuType]);
return TRUE;
}
BOOL CLssu::GetMessageDecodeInfo(BYTE *u_pMsg, DWORD u_msgLength, char *v_pDecodeResult)
{
int strLength;
BYTE temp;
strLength = 0;
sprintf(&v_pDecodeResult[strLength], \
"%02X BSN :%d \n",
u_pMsg[0], u_pMsg[0] & 0x7F);
strLength = strlen(v_pDecodeResult);
sprintf(&v_pDecodeResult[strLength], \
" BIB :%d....... \n", \
(u_pMsg[0] >> 7) & 0x01);
strLength = strlen(v_pDecodeResult);
sprintf(&v_pDecodeResult[strLength], \
"%02X FSN :%d \n",
u_pMsg[1], u_pMsg[1] & 0x7F);
strLength = strlen(v_pDecodeResult);
sprintf(&v_pDecodeResult[strLength], \
" FIB :%d....... \n", \
(u_pMsg[1] >> 7) & 0x01);
strLength = strlen(v_pDecodeResult);
sprintf(&v_pDecodeResult[strLength], \
"%02X LI :%d Length Indicator. \n",
u_pMsg[2], u_pMsg[2] & 0x3F);
strLength = strlen(v_pDecodeResult);
sprintf(&v_pDecodeResult[strLength], \
" SPARE :%d%d...... \n",
(u_pMsg[2] >> 7) & 0x01, (u_pMsg[2] >> 6) & 0x01);
strLength = strlen(v_pDecodeResult);
temp = u_pMsg[3];
/* sprintf(&v_pDecodeResult[strLength], \
"%02X SF :.....%d%d%d %s \n",
temp,
(temp >> 2) & 0x01, (temp >> 1) & 0x01, temp & 0x01,
m_lssuTypeTable[temp & 0x07] );
*/
sprintf(&v_pDecodeResult[strLength], \
"%02X SF :.....%d%d%d %s \n",
temp,
(temp >> 2) & 0x01, (temp >> 1) & 0x01, temp & 0x01,
m_lssuSFTable[temp & 0x07] );
strLength = strlen(v_pDecodeResult);
sprintf(&v_pDecodeResult[strLength], \
" SPARE :%d%d%d%d%d... \n",
(temp >> 7) & 0x01, (temp >> 6) & 0x01, (temp >> 5) & 0x01,
(temp >> 4) & 0x01, (temp >> 3) & 0x01);
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -