diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-12-14 10:21:26 +0100 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-12-15 15:19:43 +0100 |
commit | 6c3dc61db58bf469c504ffbfcbe061de2f18ceac (patch) | |
tree | 10cc7351fc6b1e9fefb50087693999093ee77160 /src/gprs_coding_scheme.cpp | |
parent | 3b802e3c4ab59e6714d42298ca7b0b793e063f21 (diff) |
edge: Add header type property to GprsCodingScheme
The header type depends on the coding scheme, for GPRS there is a
single data header type per direction, for EGPRS there are 3 per
direction. In addition, control block header types are used with CS-1
only, so there is one of the per direction altogether for GRPS and
EGPRS.
This commit adds the header type enum and two methods headerTypeData
and headerTypeControl.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/gprs_coding_scheme.cpp')
-rw-r--r-- | src/gprs_coding_scheme.cpp | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/gprs_coding_scheme.cpp b/src/gprs_coding_scheme.cpp index 3488b320..9fff2c91 100644 --- a/src/gprs_coding_scheme.cpp +++ b/src/gprs_coding_scheme.cpp @@ -27,23 +27,24 @@ static struct { unsigned ext_bits; } uplink, downlink; const char *name; + GprsCodingScheme::HeaderType data_hdr; } mcs_info[GprsCodingScheme::NUM_SCHEMES] = { - {{0, 0}, {0, 0}, "UNKNOWN"}, - {{23, 0}, {23, 0}, "CS-1"}, - {{33, 7}, {33, 7}, "CS-2"}, - {{39, 3}, {39, 3}, "CS-3"}, - {{53, 7}, {53, 7}, "CS-4"}, - - {{26, 1}, {26, 1}, "MCS-1"}, - {{32, 1}, {32, 1}, "MCS-2"}, - {{41, 1}, {41, 1}, "MCS-3"}, - {{48, 1}, {48, 1}, "MCS-4"}, - - {{60, 7}, {59, 6}, "MCS-5"}, - {{78, 7}, {77, 6}, "MCS-6"}, - {{118, 2}, {117, 4}, "MCS-7"}, - {{142, 2}, {141, 4}, "MCS-8"}, - {{154, 2}, {153, 4}, "MCS-9"}, + {{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}, }; @@ -102,3 +103,8 @@ const char *GprsCodingScheme::name() const { return mcs_info[m_scheme].name; } + +GprsCodingScheme::HeaderType GprsCodingScheme::headerTypeData() const +{ + return mcs_info[m_scheme].data_hdr; +} |