summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-11-06 17:15:52 +0100
committerpespin <pespin@sysmocom.de>2020-11-10 12:55:33 +0000
commit081b1680608143ec2c08bc1b0b4a5b8b17a562ed (patch)
treebbc603228fcfd7c863c10c7a94b702590c6433d2 /library
parent563bcd6cb5fd45107e758ea44a15ac8c8e867ff1 (diff)
RLCMAC_EncDec: Implement encoding for RlcmacUlEgprsDataHeader HeaderType 1 and 2
Diffstat (limited to 'library')
-rw-r--r--library/RLCMAC_EncDec.cc39
-rw-r--r--library/RLCMAC_Templates.ttcn3
-rw-r--r--library/RLCMAC_Types.ttcn3
3 files changed, 41 insertions, 4 deletions
diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index d900108..c5fc447 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -1140,13 +1140,48 @@ OCTETSTRING enc__RlcmacUlDataBlock(const RlcmacUlDataBlock& si)
static
void enc__RlcmacUlEgprsDataHeader_type1(const EgprsUlMacDataHeader& si, TTCN_Buffer& ttcn_buffer)
{
- fprintf(stderr, "FIXME: Not implemented! %s (%s:%u)\n", __func__, __FILE__, __LINE__);
+ struct gprs_rlc_ul_header_egprs_1 egprs1;
+
+ egprs1.r = bs2uint8(si.r__ri());
+ egprs1.si = bs2uint8(si.foi__si());
+ egprs1.cv = si.countdown();
+ egprs1.tfi_hi = si.tfi() >> 0;
+ egprs1.tfi_lo = si.tfi() >> 2;
+ egprs1.bsn1_hi = si.bsn1() >> 0;
+ egprs1.bsn1_lo = si.bsn1() >> 5;
+ egprs1.bsn2_hi = si.bsn2__offset() >> 0;
+ egprs1.bsn2_lo = si.bsn2__offset() >> 2;
+ egprs1.cps = si.cps();
+ egprs1.rsb = bs2uint8(si.rsb());
+ egprs1.pi = si.pfi__ind();
+ egprs1.spare_hi = 0;
+ egprs1.spare_lo = 0;
+ egprs1.dummy = 0;
+
+ ttcn_buffer.put_s(sizeof(egprs1), (const unsigned char *)&egprs1);
}
static
void enc__RlcmacUlEgprsDataHeader_type2(const EgprsUlMacDataHeader& si, TTCN_Buffer& ttcn_buffer)
{
- fprintf(stderr, "FIXME: Not implemented! %s (%s:%u)\n", __func__, __FILE__, __LINE__);
+ struct gprs_rlc_ul_header_egprs_2 egprs2;
+
+ egprs2.r = bs2uint8(si.r__ri());
+ egprs2.si = bs2uint8(si.foi__si());
+ egprs2.cv = si.countdown();
+ egprs2.tfi_hi = si.tfi() >> 0;
+ egprs2.tfi_lo = si.tfi() >> 2;
+ egprs2.bsn1_hi = si.bsn1() >> 0;
+ egprs2.bsn1_lo = si.bsn1() >> 5;
+ egprs2.cps_hi = si.cps() >> 0;
+ egprs2.cps_lo = si.cps() >> 2;
+ egprs2.rsb = bs2uint8(si.rsb());
+ egprs2.pi = si.pfi__ind();
+ egprs2.spare_hi = 0;
+ egprs2.spare_lo = 0;
+ egprs2.dummy = 0;
+
+ ttcn_buffer.put_s(sizeof(egprs2), (const unsigned char *)&egprs2);
}
static
diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn
index f24cce1..b18c8db 100644
--- a/library/RLCMAC_Templates.ttcn
+++ b/library/RLCMAC_Templates.ttcn
@@ -421,7 +421,7 @@ module RLCMAC_Templates {
/* Template for uplink Data block */
template RlcmacUlBlock t_RLCMAC_UL_EGPRS_DATA(CodingScheme mcs,
template uint5_t tfi, template uint4_t cv,
- template uint11_t bsn1, template EgprsLlcBlocks blocks := {}) := {
+ template uint11_t bsn1, template uint8_t bsn2_offset := 0, template EgprsLlcBlocks blocks := {}) := {
data_egprs := {
mcs := mcs,
mac_hdr := {
@@ -431,6 +431,7 @@ module RLCMAC_Templates {
foi_si := '0'B,
r_ri := '0'B,
bsn1 := bsn1,
+ bsn2_offset := bsn2_offset,
cps := f_rlcmac_mcs_to_cps(mcs, 1, false),
pfi_ind := false,
rsb := '0'B,
diff --git a/library/RLCMAC_Types.ttcn b/library/RLCMAC_Types.ttcn
index 80a9997..eb9d845 100644
--- a/library/RLCMAC_Types.ttcn
+++ b/library/RLCMAC_Types.ttcn
@@ -223,7 +223,7 @@ module RLCMAC_Types {
MacRrbp rrbp,
BIT2 esp,
uint3_t usf,
- uint14_t bsn1,
+ uint11_t bsn1,
uint8_t bsn2_offset,
uint2_t pr, /* power reduction */
uint2_t spb,
@@ -279,6 +279,7 @@ module RLCMAC_Types {
BIT1 foi_si,
BIT1 r_ri,
uint11_t bsn1,
+ uint8_t bsn2_offset,
uint4_t cps,
boolean pfi_ind,
BIT1 rsb,