aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_coding_scheme.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-14 10:38:29 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-15 15:19:43 +0100
commit392a5453361d639abe3eb50ec5ea7ace1595af04 (patch)
tree45bc57f5fee52da991db6c576e77f779b64d171f /src/gprs_coding_scheme.cpp
parent4aa78a8bea0d49a5fe6b3759606afd16eaf3de88 (diff)
edge: Add information about data blocks to GprsCodingScheme
This commit adds the methods maxDataBlockBytes and numDataBlocks which provide information about the data areas within RLC messages. In these areas, the extension bytes, TLLI, and the LLC data are stored. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/gprs_coding_scheme.cpp')
-rw-r--r--src/gprs_coding_scheme.cpp48
1 files changed, 30 insertions, 18 deletions
diff --git a/src/gprs_coding_scheme.cpp b/src/gprs_coding_scheme.cpp
index 9fff2c9..04eb3b6 100644
--- a/src/gprs_coding_scheme.cpp
+++ b/src/gprs_coding_scheme.cpp
@@ -23,28 +23,30 @@
static struct {
struct {
- unsigned bytes;
- unsigned ext_bits;
+ unsigned int bytes;
+ unsigned int ext_bits;
} uplink, downlink;
+ unsigned int data_bytes;
+ unsigned int num_blocks;
const char *name;
GprsCodingScheme::HeaderType data_hdr;
} mcs_info[GprsCodingScheme::NUM_SCHEMES] = {
- {{0, 0}, {0, 0}, "UNKNOWN", GprsCodingScheme::HEADER_INVALID},
- {{23, 0}, {23, 0}, "CS-1", GprsCodingScheme::HEADER_GPRS_DATA},
- {{33, 7}, {33, 7}, "CS-2", GprsCodingScheme::HEADER_GPRS_DATA},
- {{39, 3}, {39, 3}, "CS-3", GprsCodingScheme::HEADER_GPRS_DATA},
- {{53, 7}, {53, 7}, "CS-4", GprsCodingScheme::HEADER_GPRS_DATA},
-
- {{26, 1}, {26, 1}, "MCS-1", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_3},
- {{32, 1}, {32, 1}, "MCS-2", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_3},
- {{41, 1}, {41, 1}, "MCS-3", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_3},
- {{48, 1}, {48, 1}, "MCS-4", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_3},
-
- {{60, 7}, {59, 6}, "MCS-5", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2},
- {{78, 7}, {77, 6}, "MCS-6", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2},
- {{118, 2}, {117, 4}, "MCS-7", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1},
- {{142, 2}, {141, 4}, "MCS-8", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1},
- {{154, 2}, {153, 4}, "MCS-9", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1},
+ {{0, 0}, {0, 0}, 0, 0, "UNKNOWN", GprsCodingScheme::HEADER_INVALID},
+ {{23, 0}, {23, 0}, 20, 1, "CS-1", GprsCodingScheme::HEADER_GPRS_DATA},
+ {{33, 7}, {33, 7}, 30, 1, "CS-2", GprsCodingScheme::HEADER_GPRS_DATA},
+ {{39, 3}, {39, 3}, 36, 1, "CS-3", GprsCodingScheme::HEADER_GPRS_DATA},
+ {{53, 7}, {53, 7}, 50, 1, "CS-4", GprsCodingScheme::HEADER_GPRS_DATA},
+
+ {{26, 1}, {26, 1}, 22, 1, "MCS-1", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_3},
+ {{32, 1}, {32, 1}, 28, 1, "MCS-2", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_3},
+ {{41, 1}, {41, 1}, 37, 1, "MCS-3", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_3},
+ {{48, 1}, {48, 1}, 44, 1, "MCS-4", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_3},
+
+ {{60, 7}, {59, 6}, 56, 1, "MCS-5", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2},
+ {{78, 7}, {77, 6}, 74, 1, "MCS-6", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2},
+ {{118, 2}, {117, 4}, 56, 2, "MCS-7", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1},
+ {{142, 2}, {141, 4}, 68, 2, "MCS-8", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1},
+ {{154, 2}, {153, 4}, 74, 2, "MCS-9", GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1},
};
@@ -99,6 +101,16 @@ unsigned int GprsCodingScheme::spareBitsDL() const
return mcs_info[m_scheme].downlink.ext_bits;
}
+unsigned int GprsCodingScheme::maxDataBlockBytes() const
+{
+ return mcs_info[m_scheme].data_bytes;
+}
+
+unsigned int GprsCodingScheme::numDataBlocks() const
+{
+ return mcs_info[m_scheme].num_blocks;
+}
+
const char *GprsCodingScheme::name() const
{
return mcs_info[m_scheme].name;