libosmogsm  0.9.3
Osmocom GSM library
include/osmocom/gsm/protocol/gsm_04_12.h
00001 #pragma once
00002 
00003 #include <stdint.h>
00004 
00005 /* GSM TS 04.12 definitions for Short Message Service Cell Broadcast */
00006 
00007 #define GSM412_MSG_LEN          88      /* TS 04.12 Section 3.1 */
00008 #define GSM412_BLOCK_LEN        22      /* TS 04.12 Section 3.1 */
00009 
00010 #define GSM412_SEQ_FST_BLOCK            0x0
00011 #define GSM412_SEQ_SND_BLOCK            0x1
00012 #define GSM412_SEQ_TRD_BLOCK            0x2
00013 #define GSM412_SEQ_FTH_BLOCK            0x3
00014 #define GSM412_SEQ_FST_SCHED_BLOCK      0x8
00015 #define GSM412_SEQ_NULL_MSG             0xf
00016 
00017 struct gsm412_block_type {
00018         uint8_t seq_nr : 4,
00019                 lb : 1,
00020                 lpd : 2,
00021                 spare : 1;
00022 } __attribute__((packed));
00023 
00024 struct gsm412_sched_msg {
00025         uint8_t beg_slot_nr : 6,
00026                 type : 2;
00027         uint8_t end_slot_nr : 6,
00028                 spare1 : 1, spare2: 1;
00029         uint8_t cbsms_msg_map[6];
00030         uint8_t data[0];
00031 } __attribute__((packed));