summaryrefslogtreecommitdiffstats
path: root/include/osmocom/gsm
diff options
context:
space:
mode:
Diffstat (limited to 'include/osmocom/gsm')
-rw-r--r--include/osmocom/gsm/protocol/gsm_03_41.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/osmocom/gsm/protocol/gsm_03_41.h b/include/osmocom/gsm/protocol/gsm_03_41.h
index 0ece6ccf..40051cd4 100644
--- a/include/osmocom/gsm/protocol/gsm_03_41.h
+++ b/include/osmocom/gsm/protocol/gsm_03_41.h
@@ -2,8 +2,13 @@
#include <stdint.h>
+#include <osmocom/core/endian.h>
#include <osmocom/gsm/protocol/gsm_04_12.h>
+#ifndef OSMO_IS_LITTLE_ENDIAN
+ #define OSMO_IS_LITTLE_ENDIAN 0
+#endif
+
/* GSM TS 03.41 definitions also TS 23.041*/
#define GSM341_MAX_PAYLOAD (GSM412_MSG_LEN-sizeof(struct gsm341_ms_message))
@@ -13,19 +18,36 @@
/* Chapter 9.3.2 */
struct gsm341_ms_message {
struct {
+#if OSMO_IS_LITTLE_ENDIAN == 1
uint8_t code_hi:6;
uint8_t gs:2;
uint8_t update:4;
uint8_t code_lo:4;
+#else
+ uint8_t gs:2;
+ uint8_t code_hi:6;
+ uint8_t code_lo:4;
+ uint8_t update:4;
+#endif
} serial;
uint16_t msg_id;
struct {
+#if OSMO_IS_LITTLE_ENDIAN == 1
uint8_t language:4;
uint8_t group:4;
+#else
+ uint8_t group:4;
+ uint8_t language:4;
+#endif
} dcs;
struct {
+#if OSMO_IS_LITTLE_ENDIAN == 1
uint8_t total:4;
uint8_t current:4;
+#else
+ uint8_t current:4;
+ uint8_t total:4;
+#endif
} page;
uint8_t data[0];
} __attribute__((packed));
@@ -33,12 +55,21 @@ struct gsm341_ms_message {
/* Chapter 9.4.1.3 */
struct gsm341_etws_message {
struct {
+#if OSMO_IS_LITTLE_ENDIAN == 1
uint8_t code_hi:4;
uint8_t popup:1;
uint8_t alert:1;
uint8_t gs:2;
uint8_t update:4;
uint8_t code_lo:4;
+#else
+ uint8_t gs:2;
+ uint8_t alert:1;
+ uint8_t popup:1;
+ uint8_t code_hi:4;
+ uint8_t code_lo:4;
+ uint8_t update:4;
+#endif
} serial;
uint16_t msg_id;
uint16_t warning_type;