📄 layer3infodecode.cpp
字号:
else if((frmid.BIT128 == 1)&&(frmid.BIT127 == 0)&&(frmid.BIT124 == 1)&&(frmid.BIT123 == 0)&&(frmid.BIT122 == 0))
{
printf("sys info 2bis 512 range\t");
}
else if((frmid.BIT128 == 1)&&(frmid.BIT127 == 0)&&(frmid.BIT124 == 1)&&(frmid.BIT123 == 0)&&(frmid.BIT122 == 1))
{
printf("sys info 2bis 256 range\n");
}
else if((frmid.BIT128 == 1)&&(frmid.BIT127 == 0)&&(frmid.BIT124 == 1)&&(frmid.BIT123 == 1)&&(frmid.BIT122 == 0))
{
printf("sys info 2bis 128 range\t");
}
else if((frmid.BIT128 == 1)&&(frmid.BIT127 == 0)&&(frmid.BIT124 == 1)&&(frmid.BIT123 == 1)&&(frmid.BIT122 == 1))
{
int orig_arfcn = 0;
struct SVBitFormat bitfmt;
struct SVBitFormat vbit[111];
SCharBitMap bmap = *((SCharBitMap*)(pos));
int j = 0;
orig_arfcn = (bmap.BIT0<<9) | ((*(pos+1))<<1) |((*(pos+2)&0x80)>>7);
pos += 2;
memset(&vbit, 0, sizeof(vbit));
bmap = *((SCharBitMap*)(pos));
if(bmap.BIT6 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT5 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT4 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT3 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT2 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT1 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT0 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
pos++;
for(int i = 0; i < 13; i++)
{
SCharBitMap bmap = *((SCharBitMap*)(pos+i));
if(bmap.BIT7 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT6 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT5 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT4 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT3 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT2 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT1 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT0 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
}
pdu.PutIE(LAYER3INFO_IE_VBITMAP, sizeof(vbit), (char *)(struct SVBitFormat *)&vbit);
short linknumber = 0;
CIeBase * pIe = NULL;
struct SAddressField address_field;
pIe = pdu.GetIE(ABIS_LK_IE_LINKNUMBER);
if(pIe != NULL)
{
UINT32 data = pIe->GetIeData();
memcpy(&linknumber, (char *)&data, sizeof(short));
struct link_header joyit_header;
memcpy(&joyit_header, (char *)&data, sizeof(link_header));
pIe = pdu.GetIE(ABIS_LK_IE_ADDRESS);
if(pIe != NULL)
{
UINT32 data2 = pIe->GetIeData();
memcpy(&address_field, (char *)&data2, sizeof(SAddressField));
link_info Link_Infomation;
//Link_Infomation.linknum = linknumber;
Link_Infomation.linknum = (joyit_header.E1_num) |((joyit_header.board_num&0x07)<<3);
Link_Infomation.address_TEI = address_field.TEI;
Link_Infomation.address_SAPI = address_field.SAPI;
cellinfo_map[Link_Infomation] + Cell_Infomation.CCellInfo_vbit(LAYER3INFO_MSG_SYSTEM_INFORMATION_TYPE2BIS,(struct SVBitFormat *)&vbit);
}
}
}
else
{
printf("sys info 2bis error systeme type format\t");
}
}
//SKIP Extended BCCH Frequency List
offset += 16;
memcpy(&rach_control, &msuBuf[offset], sizeof(SRachControlParameters));
pdu.PutIE(LAYER3INFO_IE_RACH_CONTROL_PARAMETER, sizeof(SRachControlParameters), (char *)&rach_control);
//skip SI 2bis Rest Octets
{
//Add for test code
short linknumber = -1;
int pcm = -1;
int cell_id = -1;
CIeBase * pIe = NULL;
unsigned char tei = 0;
pIe = pdu.GetIE(ABIS_LK_IE_LINKNUMBER);
if(pIe != NULL)
{
UINT32 data = pIe->GetIeData();
memcpy(&linknumber, (char *)&data, sizeof(short));
pcm = linknumber / 64;
}
pIe = pdu.GetIE(ABIS_LK_IE_ADDRESS);
if(pIe != NULL)
{
UINT32 data = pIe->GetIeData();
SAddressField addr = *((SAddressField*)&data);
tei = addr.TEI;
cell_id = BtsTrx2Cell(pcm, tei-1);
}
msg_array[pcm][cell_id].system_type2bis++;
}
}
void layer3_system_information_type2ter(unsigned char *msuBuf, short msu_len, CPduBase &pdu)
{
short offset = 0;
if((msuBuf == NULL) || (msu_len <= 0)){
//Print("layer3_system_information_type2ter:input parameter error!");
return;
}
offset++;// L2 Pseudo Length
if((msuBuf[offset] & 0x0f) != RADIO_MANAGEMTNE){
//printf("layer3_system_information_type2:error RADIO_MANAGEMTNE\n");
return;
}
offset++;
if(msuBuf[offset] != LAYER3INFO_MSG_SYSTEM_INFORMATION_TYPE2TER)
{
//printf("layer3_system_information_type2:error LAYER3INFO_MSG_SYSTEM_INFORMATION_TYPE2\n");
return;
}
//store system type
pdu.PutIE(LAYER3INFO_IE_SYSTEM_TYPE, sizeof(UINT8), (char *)&msuBuf[offset]);
offset++;
{
SCellChannelDescripFormat& frmid = *((SCellChannelDescripFormat*)msuBuf+3);
unsigned char* pos = msuBuf+offset;
if(frmid.BIT128 == 0)
{
unsigned char bitmap0[124];
int j = 0;
memset(bitmap0, 0, sizeof(bitmap0));
for(int i = 15; i >= 1; --i)
{
SCharBitMap& bmap = *((SCharBitMap*)(pos+i));
bitmap0[j] = bmap.BIT0;
j++;
bitmap0[j] = bmap.BIT1;
j++;
bitmap0[j] = bmap.BIT2;
j++;
bitmap0[j] = bmap.BIT3;
j++;
bitmap0[j] = bmap.BIT4;
j++;
bitmap0[j] = bmap.BIT5;
j++;
bitmap0[j] = bmap.BIT6;
j++;
bitmap0[j] = bmap.BIT7;
j++;
}
SCharBitMap& bmap = *((SCharBitMap*)(pos));
{
bitmap0[j] = bmap.BIT0;
j++;
bitmap0[j] = bmap.BIT1;
j++;
bitmap0[j] = bmap.BIT2;
j++;
bitmap0[j] = bmap.BIT3;
}
pdu.PutIE(LAYER3INFO_IE_BITMAP0, sizeof(bitmap0), (char *)bitmap0);
short linknumber = 0;
CIeBase * pIe = NULL;
struct SAddressField address_field;
pIe = pdu.GetIE(ABIS_LK_IE_LINKNUMBER);
if(pIe != NULL)
{
UINT32 data = pIe->GetIeData();
memcpy(&linknumber, (char *)&data, sizeof(short));
struct link_header joyit_header;
memcpy(&joyit_header, (char *)&data, sizeof(link_header));
pIe = pdu.GetIE(ABIS_LK_IE_ADDRESS);
if(pIe != NULL)
{
UINT32 data2 = pIe->GetIeData();
memcpy(&address_field, (char *)&data2, sizeof(SAddressField));
link_info Link_Infomation;
//Link_Infomation.linknum = linknumber;
Link_Infomation.linknum = (joyit_header.E1_num) |((joyit_header.board_num&0x07)<<3);
Link_Infomation.address_TEI = address_field.TEI;
Link_Infomation.address_SAPI = address_field.SAPI;
cellinfo_map[Link_Infomation] + Cell_Infomation.CCellInfo_bitmap(LAYER3INFO_MSG_SYSTEM_INFORMATION_TYPE2TER,(char *)bitmap0);
}
}
}
else if((frmid.BIT128 == 1)&&(frmid.BIT124 == 0))
{
printf("sys info 2ter 1024 range\t");
}
else if((frmid.BIT128 == 1)&&(frmid.BIT124 == 1)&&(frmid.BIT123 == 0)&&(frmid.BIT122 == 0))
{
printf("sys info 2ter 512 range\t");
}
else if((frmid.BIT128 == 1)&&(frmid.BIT124 == 1)&&(frmid.BIT123 == 0)&&(frmid.BIT122 == 1))
{
printf("sys info 2ter 256 range\n");
}
else if((frmid.BIT128 == 1)&&(frmid.BIT124 == 1)&&(frmid.BIT123 == 1)&&(frmid.BIT122 == 0))
{
printf("sys info 2ter 128 range\t");
}
else if((frmid.BIT128 == 1)&&(frmid.BIT124 == 1)&&(frmid.BIT123 == 1)&&(frmid.BIT122 == 1))
{
int orig_arfcn = 0;
struct SVBitFormat bitfmt;
struct SVBitFormat vbit[111];
SCharBitMap bmap = *((SCharBitMap*)(pos));
int j = 0;
orig_arfcn = (bmap.BIT0<<9) | ((*(pos+1))<<1) |((*(pos+2)&0x80)>>7);
pos += 2;
memset(&vbit, 0, sizeof(vbit));
bmap = *((SCharBitMap*)(pos));
if(bmap.BIT6 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT5 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT4 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT3 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT2 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT1 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT0 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
pos++;
for(int i = 0; i < 13; i++)
{
SCharBitMap bmap = *((SCharBitMap*)(pos+i));
if(bmap.BIT7 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT6 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT5 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT4 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT3 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT2 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT1 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
if(bmap.BIT0 != 0){
vbit[j].rrfcn = (orig_arfcn + (j+1)) % 1024;
//vbit[j].set = 1;
}
j++;
}
pdu.PutIE(LAYER3INFO_IE_VBITMAP, sizeof(vbit), (char *)(struct SVBitFormat *)&vbit);
short linknumber = 0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -