Fixed PDU buffer size

master
Ismael Gomez 6 years ago committed by Andre Puschmann
parent abad5c3bbf
commit c9c43e44e9

@ -63,9 +63,10 @@
// Cat 4 UE - Max number of DL-SCH transport block bits received within a TTI // Cat 4 UE - Max number of DL-SCH transport block bits received within a TTI
// 3GPP 36.306 Table 4.1.1 // 3GPP 36.306 Table 4.1.1
#define SRSLTE_MAX_BUFFER_SIZE_BITS 150752 #define SRSLTE_MAX_TBSIZE_BITS 150752
#define SRSLTE_MAX_BUFFER_SIZE_BYTES (SRSLTE_MAX_BUFFER_SIZE_BITS/8)
#define SRSLTE_BUFFER_HEADER_OFFSET 1020 #define SRSLTE_BUFFER_HEADER_OFFSET 1020
#define SRSLTE_MAX_BUFFER_SIZE_BITS (SRSLTE_MAX_TBSIZE_BITS + SRSLTE_BUFFER_HEADER_OFFSET)
#define SRSLTE_MAX_BUFFER_SIZE_BYTES (SRSLTE_MAX_TBSIZE_BITS / 8 + SRSLTE_BUFFER_HEADER_OFFSET)
//#define SRSLTE_BUFFER_POOL_LOG_ENABLED //#define SRSLTE_BUFFER_POOL_LOG_ENABLED

@ -2091,7 +2091,7 @@ void rrc::write_pdu_pcch(unique_byte_buffer_t pdu)
void rrc::process_pcch(unique_byte_buffer_t pdu) void rrc::process_pcch(unique_byte_buffer_t pdu)
{ {
if (pdu->N_bytes > 0 && pdu->N_bytes < SRSLTE_MAX_BUFFER_SIZE_BITS) { if (pdu->N_bytes > 0 && pdu->N_bytes < SRSLTE_MAX_BUFFER_SIZE_BYTES) {
pcch_msg_s pcch_msg; pcch_msg_s pcch_msg;
asn1::bit_ref bref(pdu->msg, pdu->N_bytes); asn1::bit_ref bref(pdu->msg, pdu->N_bytes);
if (pcch_msg.unpack(bref) != asn1::SRSASN_SUCCESS or pcch_msg.msg.type().value != pcch_msg_type_c::types_opts::c1) { if (pcch_msg.unpack(bref) != asn1::SRSASN_SUCCESS or pcch_msg.msg.type().value != pcch_msg_type_c::types_opts::c1) {
@ -2148,7 +2148,7 @@ void rrc::process_pcch(unique_byte_buffer_t pdu)
void rrc::write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) void rrc::write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu)
{ {
if (pdu->N_bytes > 0 && pdu->N_bytes < SRSLTE_MAX_BUFFER_SIZE_BITS) { if (pdu->N_bytes > 0 && pdu->N_bytes < SRSLTE_MAX_BUFFER_SIZE_BYTES) {
//TODO: handle MCCH notifications and update MCCH //TODO: handle MCCH notifications and update MCCH
if (0 == lcid && !serving_cell->has_mcch) { if (0 == lcid && !serving_cell->has_mcch) {
asn1::bit_ref bref(pdu->msg, pdu->N_bytes); asn1::bit_ref bref(pdu->msg, pdu->N_bytes);

Loading…
Cancel
Save