Chinaunix首页 | 论坛 | 博客
  • 博客访问: 407118
  • 博文数量: 286
  • 博客积分: 6011
  • 博客等级: 准将
  • 技术积分: 3010
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-06 10:08
文章分类

全部博文(286)

文章存档

2011年(1)

2009年(285)

我的朋友

分类: 系统运维

2009-07-20 11:20:24

  1. #include "StdAfx.h"    
  2. #include "CfpFp.h"//#include "CFpFach.h"    
  3.    
  4. CFpFach::CFpFach()   
  5. {   
  6.   pMsgHead=NULL;       
  7. }   
  8.    
  9. CFpFach::~CFpFach() // 雒江涛 2006-3-28    
  10. {   
  11.     CFp *p;            
  12.     CFpRlc *pr;    
  13.        
  14.     int fp_num = CFPPduArray.GetCount();       
  15.     int rlc_num = RLCPduArray.GetCount();   
  16.        
  17.     for(int i = 0;i"new" CFpRlc { i="0;i for(int k="ConfigInf.m_MapLChSet.GetSize();" k; int ConfigInf="FpConfigInf[0];//这里主控仍然传入一个FPPARA_ARRAY类型的配置信息数组。但是在没有协同的情况下,该数组只有一个元素。" if(Num) Num="FpConfigInf.GetSize();" &FpConfigInf) CFpFach::Initial(FPPARA_ARRAY WORD } pr; delete RLCPduArray.RemoveHead(); pr="RLCPduArray.GetHead();" j="0;j p; CFPPduArray.RemoveHead(); p="CFPPduArray.GetHead();">SetDir(ConfigInf.nDirection);   
  18.         p->SetTrCh(ConfigInf.eTrChType);   
  19.         RLCPduArray.AddToRear(p);   
  20.     }   
  21.     mac.Initialize(ConfigInf.m_MapLChSet);   
  22.     mac.SetTrCh(ConfigInf.eTrChType);   
  23.     mac.SetDir(ConfigInf.nDirection);   
  24.     }   
  25. cfp.SetDir(ConfigInf.nDirection);   
  26.     return 0;   
  27. }   
  28.    
  29.    
  30. WORD CFpFach::Decode(CString &res)   
  31. {   
  32.     pMsgHead = GetHeadPointer();   
  33.     PduLength=GetBitLength();   
  34.     FTbyte  *pFTbyteSruct;   
  35.     pFTbyteSruct=(FTbyte *)pMsgHead;   
  36.     if ((*pFTbyteSruct).FT==1)//控制桢    
  37.     {//1    
  38.         CCHControlFrameDecode(pMsgHead,PduLength,res);   
  39.         return 0;   
  40.     }//1    
  41.     else//传输桢    
  42.     {//2    
  43.         WORD DecodeState;   
  44.         DecodeState=CCHFACHDecode(pMsgHead,PduLength,res);   
  45.         if(DecodeState==0)   
  46.         {   
  47.         WORD TBNumber;//一个传输信道内的TB块数量    
  48.         TBNumber=CHTBStruct.TBSByteLength/CHTBStruct.TBByteLenth;   
  49.         DWORD nBitLength;   
  50.         nBitLength=CHTBStruct.TBbitLength;   
  51.         BYTE *pPduData;   
  52.         pPduData=(BYTE *)CHTBStruct.pFirstTB;   
  53.         for(int i=0;i SetTBSeg(TBNumber);   
  54.         }//2.1.1    
  55.         int j=1;   
  56.         for(;TBNumber>=1;)   
  57.         {//2.1.2    
  58.             mac.Create(nBitLength, pPduData);   
  59.             BYTE CHid;   
  60.             WORD MacDecodeState;   
  61.             CString str;//    
  62.             str.Format(_T("⑴Transport Block"));   
  63.             res+=str;//增加新的格式  2006年4月12日    
  64.             MacDecodeState=mac .Decode(res, CHid);   
  65.             if(MacDecodeState!=0)   
  66.             {   
  67.                 res+=TrailStr;//4.13新的输出格式    
  68.                 TrailStr.Empty();   
  69.                 return 1;   
  70.             }   
  71.             mac .GetSdu(*RLCPduArray.GetAt(CHid));   
  72.             WORD RlcDecoedState;   
  73.    
  74.             RlcDecoedState=RLCPduArray.GetAt(CHid)->Decode(res);   
  75.             if(RlcDecoedState!=0)   
  76.             {   
  77.                 res+=TrailStr;//4.13新的输出格式    
  78.                 TrailStr.Empty();   
  79.                 return 1;   
  80.             }   
  81.             WORD rrcpduState=2;//rrcpduState先定义值为2,目的是进入下边for循环内。    
  82.             for(;(rrcpduState!=1)&&(rrcpduState!=0);)   
  83.             {//2.1.2.1    
  84.                 rrcpduState=RLCPduArray.GetAt(CHid)->GetSdu(cfp);   
  85.                 if (rrcpduState!=1)    
  86.                 {//2.1.2.1.1    
  87.                     CFp *pCFP=new CFp;   
  88.                     *pCFP=cfp;   
  89.                     CFPPduArray.AddToRear(pCFP);                 
  90.                 }//2.1.2.1.1    
  91.             }//2.1.2.1    
  92. //          str.Format(_T("⑴Padding"));//    
  93. //          res+=Pad;    
  94.             res+=PadStr[j];   
  95.             j++;   
  96.             TBNumber--;   
  97.             pPduData= pPduData+ CHTBStruct.TBByteLenth;//指针移到下一个TB块开始位置。              
  98.         }//2.1.2    
  99.         res+=TrailStr;//4.13新的输出格式    
  100.         TrailStr.Empty();   
  101.         return 0;   
  102.         }   
  103.         else   
  104.         {   
  105.             return 1;   
  106.         }   
  107.    
  108.     }//2    
  109.     return 0;   
  110. }   
  111.    
  112. DWORD CFpFach::CiteMacGetUEID()   
  113. {   
  114.     DWORD UEID;   
  115.     UEID=mac.GetUEID();   
  116.     return UEID;   
  117. }   
  118. DWORD CFpFach::CiteMacGetUEIDType()   
  119. {   
  120.     DWORD UEIDType;   
  121.     UEIDType=mac.GetUEIDType();   
  122.     return UEIDType;   
  123. }   
  124.    
  125. WORD CFpFach::GetSdu(CFp &sdu)   
  126. {   
  127.     int n;   
  128.     n=CFPPduArray.GetCount();   
  129.     if(n>0)   
  130.     {   
  131.     CFp *k = CFPPduArray.GetHead();   
  132.     sdu = *k;   
  133.     CFPPduArray.RemoveHead();   
  134.     delete k;          
  135.     if (n==1)    
  136.     {   
  137.         return 0;   
  138.     }   
  139.     else   
  140.     {   
  141.         return 2;   
  142.     }   
  143.     }   
  144.     else   
  145.     {   
  146.         return 1;   
  147.     }   
  148. }   
  149.    
  150. WORD CFpFach::CCHFACHDecode(BYTE *pMsg, WORD Length, CString &res)   
  151. {   
  152.     CString str;   
  153.     BYTE *temp=pMsg;   
  154.     for(int i=0;i<50;i++)   
  155.     {   
  156.         PadStr[i].Empty();   
  157.     }   
  158.    
  159.     WORD PDULength;//3月15日晚间修改    
  160.     PDULength=GetBitLength();//3月15日晚间修改    
  161.     int PDUByteLength;   
  162.     PDUByteLength=PDULength/8;   
  163. //  PDUByteLength=PDUByteLength-4-(ConfigInf.wCrcBitSize/8);//如果PDULength在减去FP帧的帧头和帧尾以后小于0,那么不解码,返回解码错误信息。    
  164.     PDUByteLength=PDUByteLength-4;   
  165.     if(PDUByteLength>0)   
  166.     {//11 3月15日,修改增加程序健壮性。    
  167.        
  168.     str.Format(_T("#FP FACH: Data"));// Modify on 4/12 by QiYing    
  169.     res+=str;   
  170.        
  171.     str.Format(_T("⑴Header"));   
  172.     res+=str;   
  173.        
  174.     str.Format(_T("@FT(Frame Type)|%X|数据帧"),*temp&0x01);   
  175.     res+=str;   
  176.        
  177.     str.Format(_T("@Header CRC|%X|帧头CRC"),(*temp&0xfe)>>1);   
  178.     res+=str;   
  179.     temp++;   
  180.        
  181.     str.Format(_T("@CFN(Connection Frame Number)|%X|连接帧号"),*temp);   
  182.     res+=str;   
  183.     temp++;   
  184.        
  185.     BYTE value=*temp&0x1f;   
  186.     str.Format(_T("@TFI(Transport Format Indicator)|%X|传输格式指示"),value);   
  187.     res+=str;   
  188.     temp++;   
  189.        
  190.     str.Format(_T("@Transmit power level|%X|传输功率级别"),*temp);   
  191.     res+=str;   
  192.     temp++;   
  193.    
  194.     WORD j;//TBbitLength  3月15日,修改增加程序健壮性。    
  195.     WORD k;//TBByteLenth  3月15日,修改增加程序健壮性。    
  196.     WORD m;//TBSByteLength 3月15日,修改增加程序健壮性。    
  197.        
  198.     if(ConfigInf.m_Tfs[value].wNumOfTb!=0)   
  199.     {   
  200.        
  201.     j=ConfigInf.m_Tfs[value].wTbsSize/ConfigInf.m_Tfs[value].wNumOfTb;//3月15日,修改增加程序健壮性。    
  202.     if(j%8)//3月15日,修改增加程序健壮性。    
  203.         k=j/8+1;//3月15日,修改增加程序健壮性。    
  204.     else//3月15日,修改增加程序健壮性。    
  205.         k=j/8;//3月15日,修改增加程序健壮性。    
  206.        
  207.     m=ConfigInf.m_Tfs[value].wNumOfTb*k;// 3月15日,修改增加程序健壮性。    
  208.     }   
  209.     else   
  210.     {   
  211.         str.Format(_T("@TB块个数为0!"));   
  212.         res+=str;   
  213.         m=0;       
  214.     }   
  215.     PDUByteLength=PDUByteLength-m;// 3月15日,修改增加程序健壮性。    
  216.     if(PDUByteLength>=0)////严格判断数据中实际的TB长度和TFI指示的传输格式长度是否相等,相等进行TB块解码,否则报错返回。    
  217.     {//4 3月15日,修改增加程序健壮性。    
  218.        
  219.    
  220.        
  221.     TBSstruct* tempstruct=new TBSstruct;   
  222.     tempstruct->pFirstTB=temp;   
  223.     tempstruct->TFIvalue=value;   
  224.    
  225.     tempstruct->TBbitLength=ConfigInf.m_Tfs[value].wTbsSize/ConfigInf.m_Tfs[value].wNumOfTb;   
  226.     if(tempstruct->TBbitLength%8)   
  227.     {   
  228.         int c;   
  229.            
  230.         tempstruct->TBByteLenth=tempstruct->TBbitLength/8+1;   
  231.         tempstruct->TBSByteLength=ConfigInf.m_Tfs[value].wNumOfTb*tempstruct->TBByteLenth;   
  232.    
  233.         for(int n=1;n<=ConfigInf.m_Tfs[value].wNumOfTb;n++)   
  234.         {   
  235.             c=tempstruct->TBbitLength%8;   
  236.             temp+=tempstruct->TBByteLenth-1;//pointing to the last byte of the current TB    
  237.             int b[50];   
  238.             b[n]=*temp&(255>>c);   
  239.             temp++;   
  240. //          PadStr[n].Format(_T("@Padding|%X|填充"),b[n]);    
  241.             str.Format(_T("⑴Padding"));   
  242.             PadStr[n]+=str;   
  243.             str.Format(_T("@Padding|%X|填充"),b[n]);   
  244.             PadStr[n]+=str;   
  245.    
  246.    
  247.         }   
  248.        
  249.     }   
  250.     else   
  251.     {   
  252.         tempstruct->TBByteLenth=tempstruct->TBbitLength/8;   
  253.         tempstruct->TBSByteLength=ConfigInf.m_Tfs[value].wNumOfTb*tempstruct->TBByteLenth;   
  254.         temp+=tempstruct->TBSByteLength;   
  255.     }   
  256.        
  257.     CHTBStruct=*tempstruct;   
  258.    
  259.        
  260.     if(PDUByteLength>0)   
  261.     {   
  262.         str.Format(_T("⑴Trailer"));   
  263.         TrailStr+=str;   
  264.         str.Format(_T("@Payload CRC|%s|净荷CRC"),ConvertToHexStr(temp,2,TRUE));   
  265.         TrailStr+=str;   
  266.         return 0;   
  267.     }   
  268.     else    
  269.     {   
  270.         str.Format(_T("待解码数据错误!"));   
  271.         res+=str;   
  272.         return 1;   
  273.     }   
  274.            
  275.     }//4 3月15日,修改增加程序健壮性。    
  276.     else   
  277.     {   
  278.  str.Format(_T("数据与传输格式集不符!"));   
  279.        res+=str;   
  280.         return 1;   
  281.     }   
  282.        
  283.     }      
  284.        
  285.     else   
  286.     {   
  287.         str.Format(_T("待解码数据错误!"));   
  288.     res+=str;   
  289.         return 1;   
  290.     }   
  291.            
  292. }   
  293.    
  294. WORD CFpFach::CCHControlFrameDecode(BYTE *pMsg, WORD Length, CString &res)   
  295. {   
  296.     BYTE* temp=pMsg;   
  297.     CString str;   
  298.    
  299.     Length=Length/8;   
  300.    
  301.     BYTE Type=*(temp+1);   
  302.     WORD a;   
  303.     DWORD a1;   
  304.     int toa;   
  305.     long toa1;   
  306.     DWORD t1;   
  307.     DWORD t2;   
  308.     DWORD t3;   
  309.     BYTE t_h;   
  310.     BYTE t_m;   
  311.     BYTE t_l;   
  312.     float t;   
  313.     BYTE toa_h;   
  314.     BYTE toa_m;   
  315.     BYTE toa_l;   
  316.    
  317.     switch(Type) {   
  318.     case 0x01:   
  319.         str.Format(_T("#FP FACH: Outer Loop Power Control"));// Modify on 4/12 by QiYing    
  320.         res+=str;   
  321.            
  322.            
  323.         str.Format(_T("⑴Header"));   
  324.         res+=str;   
  325.            
  326.         str.Format(_T("@FT(Frame Type)|%X|控制帧"),*temp&0x01);   
  327.         res+=str;   
  328.            
  329.         str.Format(_T("@Frame CRC|%X|帧头CRC"),(*temp&0xfe)>>1);   
  330.         res+=str;   
  331.         temp++;   
  332.            
  333.         str.Format(_T("@Control Frame Type|%X|"),*temp);   
  334.         res+=str;   
  335.    
  336.         str.Format(_T("Outer Loop Power Control"));   
  337.         res+=str;   
  338.         temp++;   
  339.         str.Format(_T("⑴Payload"));   
  340.         res+=str;   
  341.         str.Format(_T("@UL_SIR_TARGET|%X|SIR目标值:%d dB"),*temp,0.1*(*temp)-8.2);   
  342.         res+=str;   
  343.         temp++;   
  344.         if(Length-3)   
  345.         {   
  346.             str.Format(_T("⑴Trailer"));   
  347.             res+=str;   
  348.             str.Format(_T("@Spare Extension|%s|备用扩展"),ConvertToHexStr(temp,Length-3,TRUE));   
  349.             res+=str;   
  350. //          return 0; //QiYing 4/4    
  351.         }   
  352. //      else    
  353.             return 0; //QiYing 4/4    
  354.         break;   
  355.     case 0x02:   
  356.         str.Format(_T("#FP FACH: Timing adjustment"));// Modify on 4/12 by QiYing    
  357.         res+=str;   
  358.            
  359.         str.Format(_T("⑴Header"));   
  360.         res+=str;   
  361.            
  362.         str.Format(_T("@FT(Frame Type)|%X|控制帧"),*temp&0x01);   
  363.         res+=str;   
  364.            
  365.         str.Format(_T("@Frame CRC|%X|帧头CRC"),(*temp&0xfe)>>1);   
  366.         res+=str;   
  367.         temp++;   
  368.            
  369.         str.Format(_T("@Control Frame Type|%X|"),*temp);   
  370.         res+=str;   
  371.    
  372.         str.Format(_T("Timing adjustment"));   
  373.         res+=str;   
  374.         temp++;   
  375.         str.Format(_T("⑴Payload"));   
  376.         res+=str;   
  377.         if(ConfigInf.eTrChType==P_CH)   
  378.         {   
  379.             str.Format(_T("@CFN(Connection Frame Number)|%X %X|连接帧号"),*temp,(*(temp+1)&0xf0)>>4);   
  380.             res+=str;   
  381.             temp+=2;   
  382.             toa_h=*temp;   
  383.             toa_m=*(temp+1);   
  384.             toa_l=(*(temp+2)&0xf0)>>4;   
  385.             a1=(toa_h<<12)+(toa_m<<4)+toa_l;   
  386.             toa1=(long)a1;   
  387.             str.Format(_T("@ToA|%02X %02X %02X|到达时间:%f ms"),*temp,*(temp+1),(*(temp+2)&0xf0)>>4,0.125*toa1);   
  388.             res+=str;   
  389.             temp+=3;   
  390.             if(Length-7)   
  391.             {   
  392.                 str.Format(_T("⑴Trailer"));   
  393.                 res+=str;   
  394.                 str.Format(_T("@Spare Extension|%s|备用扩展"),ConvertToHexStr(temp,Length-7,TRUE));   
  395.                 res+=str;   
  396. //              return 0; //QiYing 4/4    
  397.             }   
  398. //          else    
  399.                 return 0; //QiYing 4/4    
  400.         }   
  401.         else   
  402.         {   
  403.             str.Format(_T("@CFN(Connection Frame Number)|%X|连接帧号"),*temp);   
  404.             res+=str;   
  405.             temp++;   
  406.             toa_h=*temp;   
  407.             toa_l=*(temp+1);   
  408.             a=(toa_h<<8)+toa_l;   
  409.             toa=(int)a;   
  410.             str.Format(_T("@ToA|%02X %02X|到达时间:%f ms"),*temp,*(temp+1),0.125*toa);   
  411.             res+=str;   
  412.             temp+=2;   
  413.             if(Length-5)   
  414.             {   
  415.                 str.Format(_T("⑴Trailer"));   
  416.                 res+=str;   
  417.                 str.Format(_T("@Spare Extension|%s|备用扩展"),ConvertToHexStr(temp,Length-5,TRUE));   
  418.                 res+=str;   
  419. //              return 0;    
  420.             }   
  421. //          else    
  422.                 return 0;   
  423.         }   
  424.         break;   
  425.     case 0x03:   
  426.         str.Format(_T("#FP FACH: DL synchronisation"));// Modify on 4/12 by QiYing    
  427.         res+=str;   
  428.            
  429.        
  430.         str.Format(_T("⑴Header"));   
  431.         res+=str;   
  432.            
  433.         str.Format(_T("@FT(Frame Type)|%X|控制帧"),*temp&0x01);   
  434.         res+=str;   
  435.            
  436.         str.Format(_T("@Frame CRC|%X|帧头CRC"),(*temp&0xfe)>>1);   
  437.         res+=str;   
  438.         temp++;   
  439.            
  440.         str.Format(_T("@Control Frame Type|%X|"),*temp);   
  441.         res+=str;   
  442.    
  443.         str.Format(_T("DL synchronisation"));   
  444.         res+=str;   
  445.         temp++;   
  446.         str.Format(_T("⑴Payload"));   
  447.         res+=str;   
  448.         if(ConfigInf.eTrChType==P_CH)   
  449.         {   
  450.             str.Format(_T("@CFN(Connection Frame Number)|%02X %02X|连接帧号"),*temp,(*(temp+1)&0xf0)>>4);   
  451.             temp+=2;   
  452.             if(Length-4)   
  453.             {   
  454.                 str.Format(_T("⑴Trailer"));   
  455.                 res+=str;   
  456.                 str.Format(_T("@Spare Extension|%s|备用扩展"),ConvertToHexStr(temp,Length-4,TRUE));   
  457.                 res+=str;   
  458. //              return 0; //QiYing 4/4    
  459.             }   
  460. //          else    
  461.                 return 0; //QiYing 4/4    
  462.         }   
  463.         else   
  464.         {   
  465.             str.Format(_T("@CFN(Connection Frame Number)|%X|连接帧号"),*temp);   
  466.             if(Length-3)   
  467.             {   
  468.                 str.Format(_T("⑴Trailer"));   
  469.                 res+=str;   
  470.                 str.Format(_T("@Spare Extension|%s|备用扩展"),ConvertToHexStr(temp,Length-4,TRUE));   
  471.                 res+=str;   
  472. //              return 0; //QiYing 4/4    
  473.             }   
  474. //          else    
  475.                 return 0; //QiYing 4/4    
  476.         }   
  477.            
  478.         break;   
  479.     case 0x04:   
  480.         str.Format(_T("#FP FACH: UL synchronisation"));// Modify on 4/12 by QiYing    
  481.         res+=str;   
  482.            
  483.        
  484.         str.Format(_T("⑴Header"));   
  485.         res+=str;   
  486.            
  487.         str.Format(_T("@FT(Frame Type)|%X|控制帧"),*temp&0x01);   
  488.         res+=str;   
  489.            
  490.         str.Format(_T("@Frame CRC|%X|帧头CRC"),(*temp&0xfe)>>1);   
  491.         res+=str;   
  492.         temp++;   
  493.            
  494.         str.Format(_T("@Control Frame Type|%X|"),*temp);   
  495.         res+=str;   
  496.            
  497.         str.Format(_T("UL synchronisation"));   
  498.         res+=str;   
  499.         temp++;   
  500.         str.Format(_T("⑴Payload"));   
  501.         res+=str;   
  502.         if(ConfigInf.eTrChType==P_CH)   
  503.         {   
  504.             str.Format(_T("@CFN(Connection Frame Number)|%02X %02X|连接帧号"),*temp,(*(temp+1)&0xf0)>>4);   
  505.             res+=str;   
  506.             temp+=2;   
  507.             toa_h=*temp;   
  508.             toa_m=*(temp+1);   
  509.             toa_l=(*(temp+2)&0xf0)>>4;   
  510.             a1=(toa_h<<12)+(toa_m<<4)+toa_l;   
  511.             toa1=(long)a1;   
  512.             str.Format(_T("@ToA|%02X %02X %02X|到达时间:%f ms"),*temp,*(temp+1),(*(temp+2)&0xf0)>>4,toa1*0.125);   
  513.             res+=str;   
  514.             temp+=3;   
  515.             if(Length-7)   
  516.             {   
  517.                 str.Format(_T("⑴Trailer"));   
  518.                 res+=str;   
  519.                 str.Format(_T("@Spare Extension|%s|备用扩展"),ConvertToHexStr(temp,Length-7,TRUE));   
  520.                 res+=str;   
  521. //              return 0; //QiYing 4/4    
  522.             }   
  523. //          else    
  524.                 return 0; //QiYing 4/4    
  525.         }   
  526.         else   
  527.         {   
  528.             str.Format(_T("@CFN(Connection Frame Number)|%X|连接帧号"),*temp);   
  529.             res+=str;   
  530.             temp++;   
  531.             toa_h=*temp;   
  532.             toa_l=*(temp+1);   
  533.             a=(toa_h<<8)+toa_l;   
  534.             toa=(int)a;   
  535.             str.Format(_T("@ToA|%02X %02X|到达时间:%d ms"),*temp,*(temp+1),toa*0.125);   
  536.             res+=str;   
  537.             temp+=2;   
  538.             if(Length-5)   
  539.             {   
  540.                 str.Format(_T("⑴Trailer"));   
  541.                 res+=str;   
  542.                 str.Format(_T("@Spare Extension|%s|备用扩展"),ConvertToHexStr(temp,Length-5,TRUE));   
  543.                 res+=str;   
  544. //              return 0; //QiYing 4/4    
  545.             }   
  546. //          else     
  547.                 return 0; //QiYing 4/4    
  548.         }          
  549.         break;   
  550.     case 0x06:   
  551.         str.Format(_T("#FP FACH: DL Node synchronisation"));// Modify on 4/12 by QiYing    
  552.         res+=str;   
  553.            
  554.            
  555.         str.Format(_T("⑴Header"));   
  556.         res+=str;   
  557.            
  558.         str.Format(_T("@FT(Frame Type)|%X|控制帧"),*temp&0x01);   
  559.         res+=str;   
  560.            
  561.         str.Format(_T("@Frame CRC|%X|帧头CRC"),(*temp&0xfe)>>1);   
  562.         res+=str;   
  563.         temp++;   
  564.            
  565.         str.Format(_T("@Control Frame Type|%X|"),*temp);   
  566.         res+=str;   
  567.         str.Format(_T("DL Node synchronisation"));   
  568.         res+=str;   
  569.         temp++;   
  570.         str.Format(_T("⑴Payload"));   
  571.         res+=str;   
  572.         t_h=*temp;   
  573.         t_m=*(temp+1);   
  574.         t_l=*(temp+2);   
  575.         t1=(t_h<<16)+(t_m<<8)+t_l;   
  576.         t=t1*0.125;   
  577.         str.Format(_T("@T1|%s|RNC特定帧号(指示RNC通过SAP将帧发送到传输层的时间):%f ms"),ConvertToHexStr(temp,3,TRUE),t);   
  578.         res+=str;   
  579.         temp+=3;   
  580.         if(Length-5)   
  581.         {   
  582.             str.Format(_T("⑴Trailer"));   
  583.             res+=str;   
  584.             str.Format(_T("@Spare Extension|%s|备用扩展"),ConvertToHexStr(temp,Length-5,TRUE));   
  585.             res+=str;   
  586. //          return 0; //QiYing 4/4    
  587.         }   
  588. //      else    
  589.             return 0; //QiYing 4/4    
  590.         break;   
  591.     case 0x07:   
  592.         str.Format(_T("#FP FACH: UL Node synchronisation"));// Modify on 4/12 by QiYing    
  593.         res+=str;   
  594.    
  595.         str.Format(_T("⑴Header"));   
  596.         res+=str;   
  597.            
  598.         str.Format(_T("@FT(Frame Type)|%X|控制帧"),*temp&0x01);   
  599.         res+=str;   
  600.            
  601.         str.Format(_T("@Frame CRC|%X|帧头CRC"),(*temp&0xfe)>>1);   
  602.         res+=str;   
  603.         temp++;   
  604.            
  605.         str.Format(_T("@Control Frame Type|%X|"),*temp);   
  606.         res+=str;   
  607.         str.Format(_T("UL Node synchronisation"));   
  608.         res+=str;   
  609.         temp++;   
  610.        
  611.         str.Format(_T("⑴Payload"));   
  612.         res+=str;   
  613.         t_h=*temp;   
  614.         t_m=*(temp+1);   
  615.         t_l=*(temp+2);   
  616.         t1=(t_h<<16)+(t_m<<8)+t_l;   
  617.         t=t1*0.125;   
  618.         str.Format(_T("@T1|%s|RNC特定帧号(指示RNC通过SAP将帧发送到传输层的时间):%f ms"),ConvertToHexStr(temp,3,TRUE),t);   
  619.         res+=str;   
  620.         temp+=3;   
  621.         t_h=*temp;   
  622.         t_m=*(temp+1);   
  623.         t_l=*(temp+2);   
  624.         t2=(t_h<<16)+(t_m<<8)+t_l;   
  625.         t=t2*0.125;   
  626.         str.Format(_T("@T2|%s|Node B 特定帧号(BFN)(指示了当Node B从传输层通过SAP收到相应下行同步帧的时间):%f ms"),ConvertToHexStr(temp,3,TRUE),t);   
  627.         res+=str;   
  628.         temp+=3;   
  629.         t_h=*temp;   
  630.         t_m=*(temp+1);   
  631.         t_l=*(temp+2);   
  632.         t3=(t_h<<16)+(t_m<<8)+t_l;   
  633.         t=t3*0.125;   
  634.         str.Format(_T("@T3|%s|Node B 特定帧号(BFN)(指示了当Node B 通过SAP向传输层发送帧的时间):%f ms"),ConvertToHexStr(temp,3,TRUE),t);   
  635.         res+=str;   
  636.         temp+=3;   
  637.         if(Length-11)   
  638.         {   
  639.             str.Format(_T("⑴Trailer"));   
  640.             res+=str;   
  641.             str.Format(_T("@Spare Extension|%s|备用扩展"),ConvertToHexStr(temp,Length-11,TRUE));   
  642.             res+=str;   
  643. //          return 0; //QiYing 4/4    
  644.         }   
  645. //      else    
  646.             return 0; //QiYing 4/4    
  647.         break;   
  648.     case 0x08:   
  649.         str.Format(_T("#FP FACH: Dynamic PUSCH assignment"));// Modify on 4/12 by QiYing    
  650.         res+=str;   
  651.            
  652.         str.Format(_T("⑴Header"));   
  653.         res+=str;   
  654.            
  655.         str.Format(_T("@FT(Frame Type)|%X|控制帧"),*temp&0x01);   
  656.         res+=str;   
  657.            
  658.         str.Format(_T("@Frame CRC|%X|帧头CRC"),(*temp&0xfe)>>1);   
  659.         res+=str;   
  660.         temp++;   
  661.            
  662.         str.Format(_T("@Control Frame Type|%X|"),*temp);   
  663.         res+=str;   
  664.         str.Format(_T("Dynamic PUSCH assignment"));   
  665.         res+=str;   
  666.         temp++;   
  667.         str.Format(_T("⑴Payload"));   
  668.         res+=str;   
  669.         str.Format(_T("@PUSCH Set Id|%X|PUSCH集指示"),*temp);   
  670.         res+=str;   
  671.         temp++;   
  672.         str.Format(_T("@Activation CFN|%X|激活CFN:指定PUSCH集分配周期开始处的连接帧号"),*temp);   
  673.         res+=str;   
  674.         temp++;   
  675.         if(Length-4)   
  676.         {   
  677.             str.Format(_T("⑴Trailer"));   
  678.             res+=str;   
  679.             str.Format(_T("@Spare Extension|%s|备用扩展"),ConvertToHexStr(temp,Length-4,TRUE));   
  680.             res+=str;   
  681. //          return 0; //QiYing 4/4    
  682.         }   
  683. //      else    
  684.             return 0; //QiYing 4/4    
  685.         break;   
  686.     default:   
  687.         str.Format(_T("@error"));   
  688.         res+=str;   
  689.         return 1;   
  690.         break;   
  691.     }   
  692. }  
阅读(488) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~