aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_coding_scheme.h
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-14 10:21:26 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-15 15:19:43 +0100
commit6c3dc61db58bf469c504ffbfcbe061de2f18ceac (patch)
tree10cc7351fc6b1e9fefb50087693999093ee77160 /src/gprs_coding_scheme.h
parent3b802e3c4ab59e6714d42298ca7b0b793e063f21 (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.h')
-rw-r--r--src/gprs_coding_scheme.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h
index 71b64cf7..7ba24dec 100644
--- a/src/gprs_coding_scheme.h
+++ b/src/gprs_coding_scheme.h
@@ -40,6 +40,15 @@ public:
EGPRS,
};
+ enum HeaderType {
+ HEADER_INVALID,
+ HEADER_GPRS_CONTROL,
+ HEADER_GPRS_DATA,
+ HEADER_EGPRS_DATA_TYPE_1,
+ HEADER_EGPRS_DATA_TYPE_2,
+ HEADER_EGPRS_DATA_TYPE_3,
+ };
+
GprsCodingScheme(Scheme s = UNKNOWN);
operator bool() const {return m_scheme != UNKNOWN;}
@@ -62,6 +71,8 @@ public:
unsigned int spareBitsUL() const;
unsigned int spareBitsDL() const;
const char *name() const;
+ HeaderType headerTypeData() const;
+ HeaderType headerTypeControl() const;
static GprsCodingScheme getBySizeUL(unsigned size);
@@ -108,6 +119,11 @@ inline void GprsCodingScheme::dec(Mode mode)
m_scheme = new_cs;
}
+inline GprsCodingScheme::HeaderType GprsCodingScheme::headerTypeControl() const
+{
+ return HEADER_GPRS_CONTROL;
+}
+
inline GprsCodingScheme::GprsCodingScheme(Scheme s)
: m_scheme(s)
{