Table of Contents

gen_mch_tables.h

gen_mch_tables.c


我在代码里做出了注释,如下:

sf_alloc -> 1234 4321 2345 5432 3456 6543 4567 7654  -> total 32bits\  1  /\  2  / \  3  /\  4  /
sf_alloc>>18                                23 4554
table[ 1, 2, 3, 6, 7, 8] = 234554sf_alloc>>12                                32 3456
table[11,12,13,16,17,18] = 323456sf_alloc>>6                                 65 4345
table[21,22,23,26,27,28] = 654345sf_alloc>>0                                 67 7654
table[31,32,33,36,37,38] = 677654Finally:
table[...] 02340 05540 03230 04560 06540 03450 06770 06540   -> 40 uint8_t\    1    / \    2    / \    3    / \    4    /

gen_mch_tables.h

lib\include\srslte\common    1581    4/5/2019

/**** \section COPYRIGHT** Copyright 2013-2015 Software Radio Systems Limited** \section LICENSE** This file is part of the srsUE library.** srsUE is free software: you can redistribute it and/or modify* it under the terms of the GNU Affero General Public License as* published by the Free Software Foundation, either version 3 of* the License, or (at your option) any later version.** srsUE is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the* GNU Affero General Public License for more details.** A copy of the GNU Affero General Public License can be found in* the LICENSE file in the top-level directory of this distribution* and at http://www.gnu.org/licenses/.**/#ifndef GEN_MCH_TALBES_H
#define GEN_MCH_TALBES_H/******************************************************************************* Common mch table generation - used in phch_common of UE and ENB for MBMS*****************************************************************************/
#include <pthread.h>
#include <string.h>
#include <stdint.h>#ifdef __cplusplus
extern "C" {
#endif // __cplusplusvoid generate_frame_mch_table(uint8_t *table, uint8_t alloc);
void generate_mch_table(uint8_t *table, uint32_t sf_alloc, uint8_t num_frames); //mch multicase channel
void generate_mcch_table(uint8_t *table, uint32_t sf_alloc); //Main Control Channel_主控信道#ifdef __cplusplus
}
#endif // __cplusplus#endif // SECURITY_H

gen_mch_tables.c

lib\src\common    2748    4/5/2019    25

/**** \section COPYRIGHT** Copyright 2013-2015 Software Radio Systems Limited** \section LICENSE** This file is part of the srsUE library.** srsUE is free software: you can redistribute it and/or modify* it under the terms of the GNU Affero General Public License as* published by the Free Software Foundation, either version 3 of* the License, or (at your option) any later version.** srsUE is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the* GNU Affero General Public License for more details.** A copy of the GNU Affero General Public License can be found in* the LICENSE file in the top-level directory of this distribution* and at http://www.gnu.org/licenses/.**/#include "srslte/common/gen_mch_tables.h"/******************************************************************************* Key Generation*****************************************************************************/void generate_frame_table(uint8_t *table, uint8_t alloc)
{
/*uint8_t -> 012345678
to  table[...] = 3,4,5,6,7,8  -> 0345006780
*/table[1] = (alloc >> 5) & 0x01;         table[2] = (alloc >> 4) & 0x01;table[3] = (alloc >> 3) & 0x01;table[6] = (alloc >> 2) & 0x01;table[7] = (alloc >> 1) & 0x01;table[8] = (alloc >> 0) & 0x01;
}void generate_mch_table(uint8_t *table, uint32_t sf_alloc, uint8_t num_frames)
{ //mch multicase channelif(num_frames == 1){uint8_t alloc = (sf_alloc) & 0x3F; // 0x3F -> 0011 1111 for -> generate_frame_tablegenerate_frame_table(table, alloc);} else if(num_frames == 4){for(uint32_t j=0; j<4; j++){uint8_t alloc = (sf_alloc >> 6*(3-j)) & 0x3F; generate_frame_table(&table[j*10], alloc);/*sf_alloc -> 1234 4321 2345 5432 3456 6543 4567 7654  -> total 32bits\  1  /\  2  / \  3  /\  4  /sf_alloc>>18                                23 4554  table[ 1, 2, 3, 6, 7, 8] = 234554sf_alloc>>12                                32 3456table[11,12,13,16,17,18] = 323456sf_alloc>>6                                 65 4345table[21,22,23,26,27,28] = 654345sf_alloc>>0                                 67 7654table[31,32,33,36,37,38] = 677654Finally:table[...] 02340 05540 03230 04560 06540 03450 06770 06540   -> 40 uint8_t\    1    / \    2    / \    3    / \    4    /*/}}
}void generate_mcch_table(uint8_t *table, uint32_t sf_alloc)
{uint8_t alloc = (sf_alloc) & 0x3F;generate_frame_table(table, alloc);
}

srsLTE源码学习:生成多播信道表gen_mch_tables相关推荐

  1. srsLTE源码学习:逻辑信道多路复用与MAC CE分解pdu_queue.h,pdu_queue.cc

    Logical Channel Demultiplexing and MAC CE dissassemble - 逻辑信道多路复用与MAC CE分解 CE设备:Customer Edge,客户侧边缘设 ...

  2. srsLTE源码学习:度量中心:metrics_hub.h

    Table of Contents metrics_hub.h PS:<srsLTE源码学习:绑核创建线程threads.h, threads.c> metrics_hub.h lib\i ...

  3. srsLTE源码学习:安全证书polarssl

    Table of Contents liblte_ssl.h liblte_ssl.h lib\include\srslte\common    2101    4/8/2019    19 #ifn ...

  4. srsLTE源码学习:GTP:GPRS Turning Protocol- GPRS隧道协议

    Table of Contents gtpc.h * GTP-C v2 Header  GPRS Turning Protocol <GPRS Turning Protocol> GPRS ...

  5. srsLTE源码学习:S1接口抓包s1ap_pcap.h,s1ap_pcap.cc

    Table of Contents 介绍 图例 代码 s1ap_pcap.h s1ap_pcap.cc s1ap_test.cc 介绍 S1接口是LTE eNodeB(基站)与 EPC(分组核心网)之 ...

  6. srsLTE源码学习:RLC,无线链路控制子层抓包rlc_pcap.h,rlc_pcap.cc

    RLC,无线链路控制子层 RLC(Radio Link Control,无线链路层控制协议)是GPRS/WCDMA/TD-SCDMA/LTE 等无线通信系统中的无线链路控制层协议.在WCDMA系统中, ...

  7. srsLTE源码学习:协议数据单元PDU:pdu.h

    TX与RX TXD 发送数据 Transmit(tx) Data 的简写形式. RXD 接收数据 Receive(rx) Data 的简写形式. x没有特定的意思,就是一开始这么写,之后都这么用了,约 ...

  8. srsLTE源码学习:网络附属存储抓包nas_pcap.h

    Table of Contents nas_pcap.h    lib\include\srslte\common    667    4/10/2019    1 nas_pcap.cc    li ...

  9. srsLTE源码学习:MAC层抓包pcap

    Table of Contents pcap.h    lib\include\srslte\common    13945    2/28/2019    182 mac_pcap.h    lib ...

最新文章

  1. 第32章:MongoDB-索引--Capped固定集合
  2. java on RHEL5
  3. 【Deep Learning笔记】卷积神经网络必须要掌握的知识(看不懂你来打我)
  4. php多个 r n如何过滤,php怎么去掉r n
  5. SpringMVC中@ResponseBody和@RequestBody的使用
  6. python自建包的根目录可以直接import的方法
  7. Android 各种工
  8. 实用计算机相关日语词汇,计算机相关日语词汇整理2
  9. mysql 强制索引循序_mysql 强制走索引
  10. 判断pc浏览器和手机浏览器方法
  11. 任务调度与上下文切换时间测试
  12. Spark读取文本文件并转换为DataFrame
  13. 产生复选框的html,html根据复选框勾选顺序生成字符串
  14. 便携式三星mysql_三星集团某站点MySQL盲注一枚(附python验证脚本)
  15. 对象数组与普通数组 java 0913
  16. 请查收,一份让你年薪突破20W的Python爬虫笔记!
  17. 如何获取不重复的随机数
  18. OpenSSL学习(十四):基础-指令passwd
  19. android手机客户端,【图片】安卓[android]手机客户端版发布【联盟守卫吧】_百度贴吧...
  20. 科学计算机求年金,科普如何科学使用普通计算器(CPA考试小技巧)

热门文章

  1. 【vue项目使用echarts实现区域地图绘制,且可点击单独区域】
  2. solr配置中文分词器
  3. 2019.8.2闭包,作用域
  4. [BZOJ2049] [SDOI2008] 洞穴勘测
  5. jar包冲突与inode
  6. c++课程学习(未完待续)
  7. JavaScript(js)概述和使用
  8. php+go+to,让phpstrom支持codeigniter框架实现 (GO TO )转到定义的功能
  9. 计算机专业开题报告指导老师意见评语,开题报告指导教师评语
  10. python安装numba_安装与Python 3.5适配的numba