对CSN.1协议的一种通用描述解析方式.doc_第1页
对CSN.1协议的一种通用描述解析方式.doc_第2页
对CSN.1协议的一种通用描述解析方式.doc_第3页
对CSN.1协议的一种通用描述解析方式.doc_第4页
对CSN.1协议的一种通用描述解析方式.doc_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

对CSN.1协议的一种通用描述/解析方式根据CSN.1协议的描述,我实现了一种相对通用的程序描述方式,供大家参考. 项目的基本类型可分为三种:T类型和V类型和C类型, T类型表示这是一个树类型,后面跟其中包含的项目个数.V类型表示这是一个单独项目,后面跟其长度信息 (bits_len), C类型表示这是一个项目组,后面跟包含的项目数量. :=L |H ; := - ARFCN indicates 1800 band | ; - ARFCN indicates 1900 band 以上面的格式为例,应该表示为: C, 2, T, 1, V, 5, V, 1 其中C表示这是一个项目组合类型,后面的2表示包含两项, 即NCH Position和Band indicator,后面的Band indicator是一个V类型,直接跟长度信息即可.如果NCH Position存在时,其包含一项, 长度为5个bit 当某个子树或者子项的存在是可选择的,此时上面的程序描述方法显而易见是无法实现的,我又设想了一个新的类别,O, 根据类别O的实际数据来自动选择其后面的子项或子树。 以SI 4 Rest中的某项为例 L | H - truncation allowed, bits L assumed; 在SI4 Rest Octets_O后面的两项内容的存在是由前面的判断字来决定的 这样L | H 就可以描述为 O,2, CSN.1协议的某些描述为队列类型,因此又新增加一种类型模式,L, 表示List类型(Array),后面跟最大Array长度。 以下面的某个描述为例,LSA ID information很明显是一个队列模式,如果LSA identify的后续bit为0的话,表示队列结束,否则表示后续数据有效。 := 0 | 1 ; 源描述:T, 2,O, 2,V, 24,V, 10,T, 1,V, 1 可以变为 : T,1L, 8O, 2V, 24V, 10因为SI 4 rest 最大包含10个 byte, 这样即使全是ShortLSA, 最大只能容纳80/10 = 8个LSA identify, 因此设最大值为8. 在SI 13的Rest Octets中的GPRS MA中包含类似下面的结构: 用前面的V类型来描述显然是不合适的,因为后面的BITMAP是变长的,因此又增加一种类型B B 表示Bitmap类型,其后面跟len所占bit len, 再后就是 len +1长的数据。 (类似字符串) B, 6 = V, 6, V, len+ 1 (len is value form first V)某些B类型的First Bit并不存在, 因此又增加一种类型为A类型. 另外某些B类型后续的len+1可以为0, 因此又增加一种类型S, 其类似Bitmap类型, 但len=0时, 后续的V, len+1项不存在, 或者可以表示为V, 0这样, 最后定义的项目类型就分为如下几种:树的类型:T, C, O结点类型: V, B, L, A, S 下面以SI13 Rest Octets为例, 描述其结构类型和目标结构定义:原始CSN.1描述/ :=/ L|H/ / / 0 | 1 / - Defined in 3GPP TS 04.60/ 0 - PBCCH not present in cell :/ / / / / - Defined in 3GPP TS 04.60/ / |1 - PBCCH present in cell :/ / / / null | L - Receiver compatible with ealier release/ - Additions in release 99 :/ |H/ / / ;/ :=/ / / / / ;/ :=/ Pb : bit (4)/ / / 00 - BCCH carrier/ | 01 / |1 ;/ :=/ / 0 | 1 RFL number list : / 0 / / | 1 0 | 1 ARFCN index list : ;/ :=/ / 0 | 1 ;/ :=/ / 0 | 1 ;/ :=/ / / / / / / / 0 | 1 / / / - Optional extension information:/ 0 | 1 / bit (val(Extension Length) + 1)/ & ! bit * = ;/ : : =/ 0 | 1 - EGPRS supported by the cell if the choice bit is set to 1/ / / / / / * ;采用通用描述法的描述:#define SI13_REST_COUNT128static U_8 si13_rest_bufSI13_REST_COUNT =T, 5, V, 3, V, 4, T, 2, V, 2, C, 3, V, 6, L, 32, C, 1, V, 4, O, 2, B, 6, C, 2, V, 32, V, 32, L, 32, C, 1, V, 6, O, 2, C, 6, V, 8, V, 1, V, 3, V, 2, C, 9, V, 2, V, 3, V, 3, V, 3, V, 1, V, 1, V, 4, T, 3, V, 3, V, 3, V, 3, T, 1, B, 6, C, 4, T, 2, V, 1, V, 4, V, 1, V, 1, V, 1, C, 5, V, 4, V, 5, V, 5, V, 1, V, 4, C, 2, V, 4, C, 4, V, 4, V, 3, V, 3, O, 4, V, 0, V, 10, V, 6, V, 6, T, 1, V, 1;/ Tree Structure/ T, 5 / si13_rest_avail/ V, 3 / bcch_change_mark/ V, 4 / si_change_field/ T, 2 / si13_ma_avail/ V, 2 / si13_change_mark/ C, 3 / V, 6 / hsn/ L, 32 / C, 1 / must follow a tree/ V, 4 / rfl_number/ O, 2 / arfcn_ma_choise/ B, 6 / ma_bitmap_sum (bit len)/ C, 2/ V, 32 / ma_bitmap1/ V, 32 / ma_bitmap2/ L, 32 / C, 1/ V, 6 / arfcn_index/ O, 2 / pbcch_avail/ C, 6 / V, 8 / rac/ V, 1 / spgc_ccch_sup/ V, 3 / prio_acc_thr/ V, 2 / net_ctrl_order/ C, 9/ V, 2 / nmo/ V, 3 / t3168/ V, 3 / t3192/ V, 3 / drx_timer_max/ V, 1 / access_burst_type/ V, 1 / control_ack_type/ V, 4 / bs_cv_max/ T, 3 / pan_avail/ V, 3 / pan_dec/ V, 3 / pan_inc/ V, 3 / pan_max/ T, 1 / edge_info_avail/ B, 6 / ext_info_sum (bit len)/ C,4 / T, 2 / edge_avail/ V, 1 / edge_pch_req/ V, 4 / bep_period/ V, 1 / pfc_feature_mode/ V, 1 / dtm_support/ V, 1 / bss_paging_coordination/ C, 5 / V, 4 / alpha/ V, 5 / t_avg_w/ V, 5 / t_avg_t/ V, 1 / pc_meas_chan/ V, 4 / n_avg_l/ C, 2 / V, 4 / ps1_rep_period / C, 4/ V, 4 / pb/ V, 3 / tsc/ V, 3 / tn / O, 4 / pbcch_freq_option/ V, 0 / use bcch carrier (no data)/ V, 10 / arfcn/ V, 6 / maio (1)/ V, 6 / maio (2) two value are ok/ T, 1 / sgsnr_avail/ V, 1 / sgsnr/ 相应的结构定义:typedef struct boolsi13_rest_avail;S_32bcch_change_mark;S_32si_change_field;boolsi13_ma_avail;boolsi13_change_mark;S_32hsn;S_32rfl_number_sum;S_32rfl_number32;/ L , 32boolarfcn_ma_choise;S_32ma_bitmap_sum;U_32ma_bitmap1;/ 26 = 64(64+31)/32 = 2 (need 2 S_32)U_32ma_bitmap2;/ B , 6S_32arfcn_index_sum;/ L, 32S_32arfcn_index32;boolpbcch_avail;S_32rac;S_32spgc_ccch_sup;S_32prio_acc_thr;S_32net_ctrl_order;S_32nmo;S_32t3168;S_32t3192;S_32drx_timer_max;S_32access_burst_type;S_32control_ack_type;S_32bs_cv_max;boolpan_avail;S_32pan_dec;S_32pan_inc;S_32pan_max;booledge_info_avail;S_32ext_info_sum;/ 26 = 64(64+31)/32 = 2 (need 2 S_32)booledge_avail;/ B, 6S_32edge_pch_req;S_32bep_period;S_32pfc_feature_mode;S_32dtm_support;S_32bss_paging_coordination;S_32alpha;S_32t_avg_w;S_32t_avg_t;S_32pc_meas_chan;S_32n_avg_i;S_32ps1_rep_period;/ 107S_32pb;S_32tsc;S_32tn;S_32pbcch_freq_option;/ 00: no data 01: arfcn 1x:maioS_32arfcn;S_32maio_1;S_32maio_2;/ maio_1 & maio_2 is common structboolsgsnr_avail;S_32sgsnr; RR_SI13_Rest_Description; 实际数据的解析结果:000001 06 00 d0 00 58 47 eb 4a 93 b5 0a 03 14 24 2b00162b 2b 2b 2b 2b 2b 2bSystem Information 13Frame Number: 1763582 (TC: 4)Channel Type: BCCHSI 13 Rest : BCCH_CHANGE_MARK : 5 SI_CHANGE_FIELD :0 PBCCH not present : Routing Area Code (RAC) : 1 SPGC_CCCH_SUP : 0 (SPLIT_PG_CYCLE is not supported on CCCH in this cell ) PRIORITY_ACCESS_THR : 6 NETWORK_CONTROL_ORDER : 0 GPRS Cell Options IE : Network Mode of Operation (NMO) : 1 T3168 : 0(500 ms) T3192 : 7(200 ms) DRX_TIMER_MAX : 7 (64 sec) ACCESS_BURST_TYPE : 0 (8-bit format) CONTROL_ACK_TYPE : 1 (default format is RLC/MAC control block) BS_CV_MAX : 6 PAN avail : PAN_DEC : 1 PAN_INC : 2 PAN_MAX : 4(maximum value allowed for counter N3102 is 20) Extension Information : Sum : 15 EGPRS supported by the cell EGPRS_PACKET_ CHANNEL_REQUEST : 1(use two phase packet access with PACKET CHANNEL REQUEST ) BEP_PERIOD : 5 (Bit Error Probability (BEP) filter averaging period) PFC_FEATURE_MODE : 0 (The network not supports packet flow context procedures) DTM_SUPPORT : 0(not support DTM) BSS_PAGING_COORDINATION :0 (not supports Circuit-Switched paging co-ordination) GPRS Power Control Parameters : ALPHA : 0 T_AVG_W :12 T_AVG_T :10 PC_MEAS_CHAN :0 (BCCH) N_AVG_I : 2Return Value:0下面又以SI9 Rest为例,描述一下通用实现方式:原始CSN.1的描述:/ :=/ L | H / ;/ := / 0 | 1 ;/ := 0 / | 1 0 / | 1 1 ;/ := 0 | 1 / := / Relative_position: -length depends on modulus/ ;采用通用描述法的描述:#define SI9_REST_COUNT 28static U_8 si9_rest_bufSI9_REST_COUNT = C, 1, L, 10, C, 2, O, 2, V, 4, O, 2, V, 5, V,6, A, 10, C, 2, S, 4, C, 1, V, 32, V, 1;/ Tree Structure/ C, 1/ L, 10 / scheduling_list/ C, 2 / O, 2 / info_type_56_avail/ V, 4 / info_type4/ O, 2 / info_type6_avail/ V, 5 / info_type5 (5 bit)/ V, 6 / info_type6 (6 bit)/ A, 10 / List Type, almost include one item/ C, 2/ S, 4 / modulus_value (special bitmap)/ C, 1 / V, 32 / position (24=16, max is 16bit)/ V, 1 / bcch_type相应的结构定义:typedef struct S_32 scheduling_sum; struct bool info_type56_avail; S_32 info_type4; bool info_type6_avail; S_32 info_type5; S_32 info_type6; S_32 position_sum; struct S_32 modulus_value; / if modulus_value=0, then no

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论