From 166c9fc82708f1965265251225632d3e3b20f529 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Thu, 7 Jan 2016 16:04:29 +0100 Subject: edge: Support EGPRS in write_packet_downlink_assignment Add an use_egprs parameter to write_packet_downlink_assignment and add the EGPRS related fields if it is set to true. The window size is fixed at 64 blocks, link quality measurement reports have been disabled, and the other optional fields are not present. Sponsored-by: On-Waves ehf --- src/encoding.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/encoding.cpp') diff --git a/src/encoding.cpp b/src/encoding.cpp index acd8f43d..fdc8d0ae 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -269,12 +269,15 @@ void Encoding::write_packet_uplink_assignment( /* generate downlink assignment */ -void Encoding::write_packet_downlink_assignment(RlcMacDownlink_t * block, uint8_t old_tfi, - uint8_t old_downlink, struct gprs_rlcmac_tbf *tbf, uint8_t poll, - uint8_t alpha, uint8_t gamma, int8_t ta_idx, uint8_t ta_ts) +void Encoding::write_packet_downlink_assignment(RlcMacDownlink_t * block, + uint8_t old_tfi, uint8_t old_downlink, struct gprs_rlcmac_tbf *tbf, + uint8_t poll, uint8_t alpha, uint8_t gamma, int8_t ta_idx, uint8_t ta_ts, + bool use_egprs) { // Packet downlink assignment TS 44.060 11.2.7 + PDA_AdditionsR99_t *pda_r99; + uint8_t tn; block->PAYLOAD_TYPE = 0x1; // RLC/MAC control block that does not include the optional octets of the RLC/MAC control header @@ -338,7 +341,18 @@ void Encoding::write_packet_downlink_assignment(RlcMacDownlink_t * block, uint8_ block->u.Packet_Downlink_Assignment.Exist_TBF_Starting_Time = 0x0; // TBF Starting TIME = off block->u.Packet_Downlink_Assignment.Exist_Measurement_Mapping = 0x0; // Measurement_Mapping = off - block->u.Packet_Downlink_Assignment.Exist_AdditionsR99 = 0x0; // AdditionsR99 = off + if (!use_egprs) { + block->u.Packet_Downlink_Assignment.Exist_AdditionsR99 = 0x0; // AdditionsR99 = off + return; + } + block->u.Packet_Downlink_Assignment.Exist_AdditionsR99 = 0x1; // AdditionsR99 = on + pda_r99 = &block->u.Packet_Downlink_Assignment.AdditionsR99; + pda_r99->Exist_EGPRS_Params = 1; + pda_r99->EGPRS_WindowSize = 0; /* 64, see TS 44.060, table 12.5.2.1 */ + pda_r99->LINK_QUALITY_MEASUREMENT_MODE = 0x0; /* no meas, see TS 44.060, table 11.2.7.2 */ + pda_r99->Exist_BEP_PERIOD2 = 0; /* No extra EGPRS BEP PERIOD */ + pda_r99->Exist_Packet_Extended_Timing_Advance = 0; + pda_r99->Exist_COMPACT_ReducedMA = 0; } /* generate paging request */ -- cgit v1.2.3