process RRC PDUs in RRC thread

master
Andre Puschmann 6 years ago
parent 27d3d697df
commit eb30d86d44

@ -326,10 +326,12 @@ private:
typedef struct { typedef struct {
enum { enum {
PDU,
PCCH, PCCH,
STOP STOP
} command; } command;
byte_buffer_t *pdu; byte_buffer_t *pdu;
uint16_t lcid;
} cmd_msg_t; } cmd_msg_t;
bool running; bool running;
@ -606,6 +608,7 @@ private:
void send_rrc_ue_cap_info(); void send_rrc_ue_cap_info();
// Parsers // Parsers
void process_pdu(uint32_t lcid, byte_buffer_t *pdu);
void parse_dl_ccch(byte_buffer_t *pdu); void parse_dl_ccch(byte_buffer_t *pdu);
void parse_dl_dcch(uint32_t lcid, byte_buffer_t *pdu); void parse_dl_dcch(uint32_t lcid, byte_buffer_t *pdu);
void parse_dl_info_transfer(uint32_t lcid, byte_buffer_t *pdu); void parse_dl_info_transfer(uint32_t lcid, byte_buffer_t *pdu);

@ -32,7 +32,7 @@
#include <time.h> #include <time.h>
#include <inttypes.h> // for printing uint64_t #include <inttypes.h> // for printing uint64_t
#include <srslte/asn1/liblte_rrc.h> #include <srslte/asn1/liblte_rrc.h>
#include "srsue/hdr/upper/rrc.h" #include <srsue/hdr/upper/rrc.h>
#include "srslte/asn1/liblte_rrc.h" #include "srslte/asn1/liblte_rrc.h"
#include "srslte/common/security.h" #include "srslte/common/security.h"
#include "srslte/common/bcd_helpers.h" #include "srslte/common/bcd_helpers.h"
@ -248,11 +248,14 @@ void rrc::run_thread() {
while(running) { while(running) {
cmd_msg_t msg = cmd_q.wait_pop(); cmd_msg_t msg = cmd_q.wait_pop();
switch(msg.command) { switch(msg.command) {
case cmd_msg_t::STOP: case cmd_msg_t::PDU:
return; process_pdu(msg.lcid, msg.pdu);
break;
case cmd_msg_t::PCCH: case cmd_msg_t::PCCH:
process_pcch(msg.pdu); process_pcch(msg.pdu);
break; break;
case cmd_msg_t::STOP:
return;
} }
} }
} }
@ -1939,6 +1942,16 @@ void rrc::write_sdu(uint32_t lcid, byte_buffer_t *sdu) {
void rrc::write_pdu(uint32_t lcid, byte_buffer_t *pdu) { void rrc::write_pdu(uint32_t lcid, byte_buffer_t *pdu) {
rrc_log->info_hex(pdu->msg, pdu->N_bytes, "RX %s PDU", get_rb_name(lcid).c_str()); rrc_log->info_hex(pdu->msg, pdu->N_bytes, "RX %s PDU", get_rb_name(lcid).c_str());
// add PDU to command queue
cmd_msg_t msg;
msg.pdu = pdu;
msg.command = cmd_msg_t::PDU;
msg.lcid = lcid;
cmd_q.push(msg);
}
void rrc::process_pdu(uint32_t lcid, byte_buffer_t *pdu)
{
switch (lcid) { switch (lcid) {
case RB_ID_SRB0: case RB_ID_SRB0:
parse_dl_ccch(pdu); parse_dl_ccch(pdu);

Loading…
Cancel
Save