blob: 826e69bd7c34ac06bb011a5a12bf13c10a38b939 [file] [log] [blame]
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02001/*! \file gsm_04_12.h
2 * GSM TS 04.12 definitions for Short Message Service Cell Broadcast. */
3
Sylvain Munaut12ba7782014-06-16 10:13:40 +02004#pragma once
Holger Hans Peter Freyther0d60aa22010-07-21 05:02:33 +08005
6#include <stdint.h>
7
Harald Welte61ced832014-12-30 13:18:26 +01008#define GSM412_MSG_LEN 88 /* TS 04.12 Section 3.1 */
9#define GSM412_BLOCK_LEN 22 /* TS 04.12 Section 3.1 */
10
Holger Hans Peter Freyther0d60aa22010-07-21 05:02:33 +080011#define GSM412_SEQ_FST_BLOCK 0x0
12#define GSM412_SEQ_SND_BLOCK 0x1
13#define GSM412_SEQ_TRD_BLOCK 0x2
14#define GSM412_SEQ_FTH_BLOCK 0x3
15#define GSM412_SEQ_FST_SCHED_BLOCK 0x8
Alex Badea3ba0a2b2010-11-27 20:00:39 +020016#define GSM412_SEQ_NULL_MSG 0xf
Holger Hans Peter Freyther0d60aa22010-07-21 05:02:33 +080017
18struct gsm412_block_type {
19 uint8_t seq_nr : 4,
20 lb : 1,
21 lpd : 2,
22 spare : 1;
23} __attribute__((packed));
24
Alex Badea3ba0a2b2010-11-27 20:00:39 +020025struct gsm412_sched_msg {
Holger Hans Peter Freyther0d60aa22010-07-21 05:02:33 +080026 uint8_t beg_slot_nr : 6,
27 type : 2;
28 uint8_t end_slot_nr : 6,
29 spare1 : 1, spare2: 1;
30 uint8_t cbsms_msg_map[6];
31 uint8_t data[0];
32} __attribute__((packed));