OBECA Receive Process
Public Types | Public Member Functions | List of all members
Rrc Class Reference

Simple RRC component between PHY and RLC. More...

#include <Rrc.h>

Inheritance diagram for Rrc:
Inheritance graph
[legend]
Collaboration diagram for Rrc:
Collaboration graph
[legend]

Public Types

enum  rrc_state_t { ACQUIRE_SIB, ACQUIRE_AREA_CONFIG, STREAMING }
 

Public Member Functions

 Rrc (const libconfig::Config &cfg, Phy &phy, srslte::rlc &rlc)
 Default constructor. More...
 
void max_retx_attempted () override
 
rrc_state_t state ()
 
void reset ()
 
void write_pdu_mch (uint32_t lcid, srslte::unique_byte_buffer_t pdu) override
 Handle a MCH PDU. More...
 
void write_pdu_bcch_dlsch (srslte::unique_byte_buffer_t pdu) override
 Handle SIB1(SIB13) from BCCH/DLSCH, and set the scheduling info in PHY.
 
void write_pdu (uint32_t lcid, srslte::unique_byte_buffer_t pdu) override
 
void write_pdu_bcch_bch (srslte::unique_byte_buffer_t pdu) override
 
void write_pdu_pcch (srslte::unique_byte_buffer_t pdu) override
 
std::string get_rb_name (uint32_t lcid) override
 

Detailed Description

Simple RRC component between PHY and RLC.

Handles only reception of SIB1 (incl. SIB13) in CAS, and MCCH PDUs.

Definition at line 34 of file Rrc.h.

Constructor & Destructor Documentation

◆ Rrc()

Rrc::Rrc ( const libconfig::Config &  cfg,
Phy &  phy,
srslte::rlc &  rlc 
)
inline

Default constructor.

Parameters
cfgConfig singleton reference
rlcRLC reference
rlcPHY reference

Definition at line 43 of file Rrc.h.

44  : _cfg(cfg)
45  , _rlc(rlc)
46  , _phy(phy) {}

Member Function Documentation

◆ write_pdu_mch()

void Rrc::write_pdu_mch ( uint32_t  lcid,
srslte::unique_byte_buffer_t  pdu 
)
override

Handle a MCH PDU.

Automatically creates MRB bearers for all discovered LCIDs, and sets the MBSFN configuration in PHY.

Definition at line 31 of file Rrc.cpp.

31  {
32  spdlog::trace("rrc: write_pdu_mch");
33  if (pdu->N_bytes <= 0 || pdu->N_bytes >= SRSLTE_MAX_BUFFER_SIZE_BITS) {
34  return;
35  }
36  asn1::cbit_ref bref(pdu->msg, pdu->N_bytes);
37  asn1::rrc::mcch_msg_s msg;
38  if (msg.unpack(bref) != asn1::SRSASN_SUCCESS ||
39  msg.msg.type().value != mcch_msg_type_c::types_opts::c1) {
40  spdlog::error("Failed to unpack MCCH message");
41  return;
42  }
43  asn1::json_writer json_writer;
44  msg.to_json(json_writer);
45  spdlog::debug("BCCH-DLSCH message content:\n{}", json_writer.to_string());
46 
47  srslte::mcch_msg_t mcch = srslte::make_mcch_msg(msg);
48 
49  // add bearers for all LCIDs
50  for (uint32_t i = 0; i < mcch.nof_pmch_info; i++) {
51  for (uint32_t j = 0; j < mcch.pmch_info_list[i].nof_mbms_session_info; j++) {
52  uint32_t lcid = mcch.pmch_info_list[i].mbms_session_info_list[j].lc_ch_id;
53  if (!_rlc.has_bearer_mrb(lcid)) {
54  _rlc.add_bearer_mrb(lcid);
55  }
56  }
57  }
58 
59  _phy.set_mbsfn_config(mcch);
60  _phy.set_decode_mcch(false);
61  _state = STREAMING;
62 }

The documentation for this class was generated from the following files:
Phy::set_mbsfn_config
void set_mbsfn_config(const srslte::mcch_msg_t &mcch)
Set MBSFN configuration values.
Definition: Phy.cpp:230
Phy::set_decode_mcch
void set_decode_mcch(bool d)
Enable MCCH decoding.
Definition: Phy.h:149