libosmogsm  0.6.3
Osmocom GSM library
gsm_03_41.h
1 #ifndef PROTO_GSM_03_41_H
2 #define PROTO_GSM_03_41_H
3 
4 #include <stdint.h>
5 
6 /* GSM TS 03.41 definitions also TS 23.041*/
7 
8 /* Chapter 9.3.2 */
10  struct {
11  uint8_t code_hi:6;
12  uint8_t gs:2;
13  uint8_t update:4;
14  uint8_t code_lo:4;
15  } serial;
16  uint16_t msg_id;
17  struct {
18  uint8_t language:4;
19  uint8_t group:4;
20  } dcs;
21  struct {
22  uint8_t total:4;
23  uint8_t current:4;
24  } page;
25  uint8_t data[0];
26 } __attribute__((packed));
27 
28 /* Chapter 9.4.1.3 */
30  struct {
31  uint8_t code_hi:4;
32  uint8_t popup:1;
33  uint8_t alert:1;
34  uint8_t gs:2;
35  uint8_t update:4;
36  uint8_t code_lo:4;
37  } serial;
38  uint16_t msg_id;
39  uint16_t warning_type;
40  uint8_t data[0];
41 } __attribute__((packed));
42 
43 #define GSM341_MSG_CODE(ms) ((ms)->serial.code_lo | ((ms)->serial.code_hi << 4))
44 
45 /* Section 9.3.2.1 - Geographical Scope */
46 #define GSM341_GS_CELL_WIDE_IMMED 0
47 #define GSM341_GS_PLMN_WIDE 1
48 #define GSM341_GS_LA_WIDE 2
49 #define GSM341_GS_CELL_WIDE 3
50 
51 #endif /* PROTO_GSM_03_41_H */