📄 ylfcommon.cpp
字号:
// ylfCommon.cpp: implementation of the ylfCommon class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MsgDetail.h"
#include "ylfCommon.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
ylfCommon::ylfCommon()
{
}
ylfCommon::~ylfCommon()
{
}
void ylfCommon::BuildColumns(CListCtrl &ListCtrl, int nCols, int *nWidth, CString *strCol,int* nFmt)
{
int i;
LV_COLUMN lvc;
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
CString strTemp;
for(i = 0; i < nCols; i++)
{
lvc.iSubItem = i;
strTemp=strCol[i];
lvc.pszText = (char*)(LPCTSTR)strTemp;
lvc.cx = nWidth[i];
lvc.fmt = (nFmt==NULL)?LVCFMT_LEFT:nFmt[i];
ListCtrl.InsertColumn(i,&lvc);
}
}
void ylfCommon::GetRecasueString(BYTE code, char *msg, int len)
{
msg[0]=0;
if(code>0)sprintf(msg,"0x%02x",code);
switch(code)
{
case 0x10: strcpy(msg,"0x10: 正常呼叫拆线");break;
case 0x01: strcpy(msg,"0x01: 未分配的号码,空号UNN");break;
case 0x02: strcpy(msg,"0x02: 无路由到指定的转接网");break;
case 0x03: strcpy(msg,"0x03: 无路由到目的地");break;
case 0x04: strcpy(msg,"0x04: 发送专用信息音SST");break;
case 0x05: strcpy(msg,"0x05: 误拔长途子冠");break;
case 0x08: strcpy(msg,"0x08: 预占");break;
case 0x09: strcpy(msg,"0x09: 预占-电路留作再用");break;
case 0x11: strcpy(msg,"0x11: 用户忙STB");break;
case 0x12: strcpy(msg,"0x12: 用户未响应");break;
case 0x13: strcpy(msg,"0x13: 用户未应答");break;
case 0x14: strcpy(msg,"0x14: 用户缺席");break;
case 0x15: strcpy(msg,"0x15: 呼叫拒收");break;
case 0x16: strcpy(msg,"0x16: 号码改变");break;
case 0x1B: strcpy(msg,"0x1B: 目的地不可达,线路不工作LOS");break;
case 0x1C: strcpy(msg,"0x1C: 无效的号码格式(地址不全)ADI");break;
case 0x1D: strcpy(msg,"0x1D: 性能拒绝");break;
case 0x1E: strcpy(msg,"0x1E");break;
case 0x1F: strcpy(msg,"0x1F: 正常-未指定");break;
case 0x22: strcpy(msg,"0x22: 无电路/通路可用CGC");break;
case 0x26: strcpy(msg,"0x26: 网络未正常工作");break;
case 0x29: strcpy(msg,"0x29: 临时故障");break;
case 0x2a: strcpy(msg,"0x2a: 交换设备拥塞SEC");break;
case 0x2b: strcpy(msg,"0x2b: 接入信息舍弃");break;
case 0x2c: strcpy(msg,"0x2c: 所请求的电路/通路不可用");break;
case 0x2e: strcpy(msg,"0x2e: 优先呼叫闭塞");break;
case 0x2f: strcpy(msg,"0x2f: 资源不可用");break;
case 0x33: strcpy(msg,"0x33: 所请求的性能未预定");break;
case 0x35: strcpy(msg,"0x35: CUG中限制去呼叫");break;
case 0x37: strcpy(msg,"0x37: CUG中限制来呼叫");break;
case 0x39: strcpy(msg,"0x39: 承载能力无权");break;
case 0x3a: strcpy(msg,"0x3a: 承载能力目前不可用");break;
case 0x3e: strcpy(msg,"0x3e: 业务/任选不可用");break;
case 0x41: strcpy(msg,"0x41: 承载能力未实现");break;
case 0x45: strcpy(msg,"0x45: 所请求的性能未实现");break;
case 0x46: strcpy(msg,"0x46: 只有受限的数字信息承载能力可用");break;
case 0x4f: strcpy(msg,"0x4f: 业务或任选未实现");break;
case 0x57: strcpy(msg,"0x57: 被叫用户不是CUG成员");break;
case 0x58: strcpy(msg,"0x58: 不兼容的目的地");break;
case 0x5a: strcpy(msg,"0x5a: 不存在的CUG");break;
case 0x5b: strcpy(msg,"0x5b: 无效的转接网选择");break;
case 0x5f: strcpy(msg,"0x5f: 无效的消息,未指定");break;
case 0x61: strcpy(msg,"0x61: 消息类型不存在或未实现");break;
case 0x63: strcpy(msg,"0x63: 参数不存在或未实现");break;
case 0x66: strcpy(msg,"0x66: 定时器终了时恢复");break;
case 0x67: strcpy(msg,"0x67: 参数不存在或未实现-传递");break;
case 0x6e: strcpy(msg,"0x6e: 消息带有未被识别的参数-舍弃");break;
case 0x6f: strcpy(msg,"0x6f: 协议错误,未指定");break;
case 0x7f: strcpy(msg,"0x7f: 互通,未指定");break;
case 0xf0: strcpy(msg,"0xf0: 地址全,用户闲,该值未被ANN,ANC覆盖,说明无后向");break;
case 0xf2: strcpy(msg,"0xf2: 用户状态未指定,该值未被ANN,ANC覆盖,说明无后向");break;
}
}
bool ylfCommon::GetMsgBAddr(BYTE* buf,char* addr,int len)
{
int li=*buf++;
BOOL oddeven=(*buf&0x80); //get odd/even
buf+=2; //buf-->addr
li-=2;
int noa=li*2; //noa=li*2
if(oddeven!=0)//奇数
{
noa--;
}
if(noa>len-1)
{
return false; //长度错误退出
}
int p=0;
for(int i=0;i<li;i++)
{
if((buf[i]&0x0f)==0x0f) //获得填充码F
{
break; //-> Next field
}
addr[p++]=(buf[i]&0x0f)+0x30;if(addr[p-1]==0x3a)addr[p-1]='A';
if((buf[i]&0xf0)==0xf0) //获得填充码F
{
break; //-> Next field
}
if(i==li-1 && oddeven!=0) //奇数
{
addr[p]=0;
break;
}
addr[p++]=((buf[i]&0xf0)>>4)+0x30;if(addr[p-1]==0x3a)addr[p-1]='A';
}
addr[p]=0; //-> Next field
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -