aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-20 00:11:37 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-21 00:31:11 +0200
commit8294368b2341bfd3f03b2383c2bf1e9a68565ba1 (patch)
treee0ebe3b443721058486e3e9cf624f0f8d6b1b5cc
parent7240062b75540747461baf42bca5c73d879985af (diff)
cbch: Implement handling of "Schedule" message
The first block of "schedule" messages must be advertised with a special sequence number coding, see Table 1 of 3GPP TS 44.012. Change-Id: I473edf698eba7ff5008f2fd1ec1776f0aa013858 Closes: OS#4012
-rw-r--r--src/common/cbch.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/common/cbch.c b/src/common/cbch.c
index c628cb5a..cde1a0c6 100644
--- a/src/common/cbch.c
+++ b/src/common/cbch.c
@@ -1,6 +1,6 @@
/* Cell Broadcast routines */
-/* (C) 2014 by Harald Welte <laforge@gnumonks.org>
+/* (C) 2014,2018-2019 by Harald Welte <laforge@gnumonks.org>
*
* All Rights Reserved
*
@@ -31,6 +31,7 @@
struct smscb_msg {
struct llist_head list; /* list in smscb_state.queue */
+ bool is_schedule; /* is this a schedule message? */
uint8_t msg[GSM412_MSG_LEN]; /* message buffer */
uint8_t next_seg; /* next segment number */
uint8_t num_segs; /* total number of segments */
@@ -78,7 +79,11 @@ static int get_smscb_block(struct gsm_bts *bts, uint8_t *out)
memcpy(out, &msg->msg[msg->next_seg * GSM412_BLOCK_LEN], to_copy);
/* set + increment sequence number */
- block_type->seq_nr = msg->next_seg++;
+ if (msg->next_seg == 0 && msg->is_schedule) {
+ block_type->seq_nr = 8; /* first schedule block */
+ msg->next_seg++;
+ } else
+ block_type->seq_nr = msg->next_seg++;
/* determine if this is the last block */
if (block_type->seq_nr + 1 == msg->num_segs)
@@ -126,6 +131,9 @@ int bts_process_smscb_cmd(struct gsm_bts *bts,
/* next segment is first segment */
scm->next_seg = 0;
+ if (cmd_type.command == RSL_CB_CMD_TYPE_SCHEDULE)
+ scm->is_schedule = true;
+
switch (cmd_type.command) {
case RSL_CB_CMD_TYPE_NORMAL:
case RSL_CB_CMD_TYPE_SCHEDULE: