libosmogsm
0.9.3
Osmocom GSM library
Main Page
Modules
Data Structures
Files
File List
Globals
gsm_03_41.h
1
#pragma once
2
3
#include <stdint.h>
4
5
#include <osmocom/gsm/protocol/gsm_04_12.h>
6
7
/* GSM TS 03.41 definitions also TS 23.041*/
8
9
#define GSM341_MAX_PAYLOAD (GSM412_MSG_LEN-sizeof(struct gsm341_ms_message))
10
#define GSM341_MAX_CHARS (GSM341_MAX_PAYLOAD*8/7)
11
#define GSM341_7BIT_PADDING '\r'
12
13
/* Chapter 9.3.2 */
14
struct
gsm341_ms_message
{
15
struct
{
16
uint8_t code_hi:6;
17
uint8_t gs:2;
18
uint8_t update:4;
19
uint8_t code_lo:4;
20
} serial;
21
uint16_t msg_id;
22
struct
{
23
uint8_t language:4;
24
uint8_t group:4;
25
} dcs;
26
struct
{
27
uint8_t total:4;
28
uint8_t current:4;
29
} page;
30
uint8_t data[0];
31
} __attribute__((packed));
32
33
/* Chapter 9.4.1.3 */
34
struct
gsm341_etws_message
{
35
struct
{
36
uint8_t code_hi:4;
37
uint8_t popup:1;
38
uint8_t alert:1;
39
uint8_t gs:2;
40
uint8_t update:4;
41
uint8_t code_lo:4;
42
} serial;
43
uint16_t msg_id;
44
uint16_t warning_type;
45
uint8_t data[0];
46
} __attribute__((packed));
47
48
#define GSM341_MSG_CODE(ms) ((ms)->serial.code_lo | ((ms)->serial.code_hi << 4))
49
50
/* Section 9.3.2.1 - Geographical Scope */
51
#define GSM341_GS_CELL_WIDE_IMMED 0
52
#define GSM341_GS_PLMN_WIDE 1
53
#define GSM341_GS_LA_WIDE 2
54
#define GSM341_GS_CELL_WIDE 3
55
56
/* Section 9.4.1.2.2 */
57
#define GSM341_MSGID_EOTD_ASSISTANCE 0x03E8
58
#define GSM341_MSGID_DGPS_CORRECTION 0x03E9
59
#define GSM341_MSGID_DGPS_EPH_CLOCK_COR 0x03EA
60
#define GSM341_MSGID_GPS_ALMANAC_OTHER 0x03EB
61
#define GSM341_MSGID_ETWS_EARTHQUAKE 0x1100
62
#define GSM341_MSGID_ETWS_TSUNAMI 0x1101
63
#define GSM341_MSGID_ETWS_QUAKE_AND_TSUNAMI 0x1102
64
#define GSM341_MSGID_ETWS_TEST 0x1103
65
#define GSM341_MSGID_ETWS_OTHER 0x1104
66
#define GSM341_MSGID_ETWS_CMAS_PRESIDENTIAL 0x1112
67
#define GSM341_MSGID_ETWS_CMAS_EXTREME_IMM_OBSERVED 0x1113
68
#define GSM341_MSGID_ETWS_CMAS_EXTREME_IMM_LIKELY 0x1114
69
#define GSM341_MSGID_ETWS_CMAS_EXTREME_EXP_OBSERVED 0x1115
70
#define GSM341_MSGID_ETWS_CMAS_EXTREME_EXP_LIKELY 0x1116
71
#define GSM341_MSGID_ETWS_CMAS_SEVERE_IMM_OBSERVED 0x1117
72
#define GSM341_MSGID_ETWS_CMAS_SEVERE_IMM_LIKELY 0x1118
73
#define GSM341_MSGID_ETWS_CMAS_SEVERE_EXP_OBSERVED 0x1119
74
#define GSM341_MSGID_ETWS_CMAS_SEVERE_EXP_LIKELY 0x111A
75
#define GSM341_MSGID_ETWS_CMAS_AMBER 0x111B
76
#define GSM341_MSGID_ETWS_CMAS_MONTHLY_TEST 0x111C
77
#define GSM341_MSGID_ETWS_CMAS_EXERCISE 0x111D
78
#define GSM341_MSGID_ETWS_CMAS_OPERATOR_DEFINED 0x111E
79
#define GSM341_MSGID_ETWS_CMAS_PRESIDENTIAL_AL 0x111F
80
#define GSM341_MSGID_ETWS_CMAS_EXTREME_IMM_OBSERVED_AL 0x1120
81
#define GSM341_MSGID_ETWS_CMAS_EXTREME_IMM_LIKELY_AL 0x1121
82
#define GSM341_MSGID_ETWS_CMAS_EXTREME_EXP_OBSERVED_AL 0x1122
83
#define GSM341_MSGID_ETWS_CMAS_EXTREME_EXP_LIKELY_AL 0x1123
84
#define GSM341_MSGID_ETWS_CMAS_SEVERE_IMM_OBSERVED_AL 0x1124
85
#define GSM341_MSGID_ETWS_CMAS_SEVERE_IMM_LIKELY_AL 0x1125
86
#define GSM341_MSGID_ETWS_CMAS_SEVERE_EXP_OBSERVED_AL 0x1126
87
#define GSM341_MSGID_ETWS_CMAS_SEVERE_EXP_LIKELY_AL 0x1127
88
#define GSM341_MSGID_ETWS_CMAS_AMBER_AL 0x1128
89
#define GSM341_MSGID_ETWS_CMAS_MONTHLY_TEST_AL 0x1129
90
#define GSM341_MSGID_ETWS_CMAS_EXERCISE_AL 0x112A
91
#define GSM341_MSGID_ETWS_CMAS_OPERATOR_DEFINED_AL 0x112B
92
#define GSM341_MSGID_ETWS_EU_INFO_LOCAL_LANGUAGE 0x1900
include
osmocom
gsm
protocol
gsm_03_41.h
Generated on Fri Nov 11 2016 15:57:09 for libosmogsm by
1.8.1.2