<p>Harald Welte has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/14090">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cbch: Implement handling of "Schedule" message<br><br>The first block of "schedule" messages must be advertised with<br>a special sequence number coding, see Table 1 of 3GPP TS 44.012.<br><br>Change-Id: I473edf698eba7ff5008f2fd1ec1776f0aa013858<br>Closes: OS#4012<br>---<br>M src/common/cbch.c<br>1 file changed, 10 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/90/14090/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/common/cbch.c b/src/common/cbch.c</span><br><span>index c628cb5..cde1a0c 100644</span><br><span>--- a/src/common/cbch.c</span><br><span>+++ b/src/common/cbch.c</span><br><span>@@ -1,6 +1,6 @@</span><br><span> /* Cell Broadcast routines */</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/* (C) 2014 by Harald Welte <laforge@gnumonks.org></span><br><span style="color: hsl(120, 100%, 40%);">+/* (C) 2014,2018-2019 by Harald Welte <laforge@gnumonks.org></span><br><span>  *</span><br><span>  * All Rights Reserved</span><br><span>  *</span><br><span>@@ -31,6 +31,7 @@</span><br><span> struct smscb_msg {</span><br><span>   struct llist_head list;         /* list in smscb_state.queue */</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   bool is_schedule;               /* is this a schedule message? */</span><br><span>    uint8_t msg[GSM412_MSG_LEN];    /* message buffer */</span><br><span>         uint8_t next_seg;               /* next segment number */</span><br><span>    uint8_t num_segs;               /* total number of segments */</span><br><span>@@ -78,7 +79,11 @@</span><br><span>  memcpy(out, &msg->msg[msg->next_seg * GSM412_BLOCK_LEN], to_copy);</span><br><span> </span><br><span>     /* set + increment sequence number */</span><br><span style="color: hsl(0, 100%, 40%);">-   block_type->seq_nr = msg->next_seg++;</span><br><span style="color: hsl(120, 100%, 40%);">+   if (msg->next_seg == 0 && msg->is_schedule) {</span><br><span style="color: hsl(120, 100%, 40%);">+           block_type->seq_nr = 8;      /* first schedule block */</span><br><span style="color: hsl(120, 100%, 40%);">+            msg->next_seg++;</span><br><span style="color: hsl(120, 100%, 40%);">+   } else</span><br><span style="color: hsl(120, 100%, 40%);">+                block_type->seq_nr = msg->next_seg++;</span><br><span> </span><br><span>      /* determine if this is the last block */</span><br><span>    if (block_type->seq_nr + 1 == msg->num_segs)</span><br><span>@@ -126,6 +131,9 @@</span><br><span>     /* next segment is first segment */</span><br><span>  scm->next_seg = 0;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+     if (cmd_type.command == RSL_CB_CMD_TYPE_SCHEDULE)</span><br><span style="color: hsl(120, 100%, 40%);">+             scm->is_schedule = true;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>        switch (cmd_type.command) {</span><br><span>  case RSL_CB_CMD_TYPE_NORMAL:</span><br><span>         case RSL_CB_CMD_TYPE_SCHEDULE:</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/14090">change 14090</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/14090"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I473edf698eba7ff5008f2fd1ec1776f0aa013858 </div>
<div style="display:none"> Gerrit-Change-Number: 14090 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Harald Welte <laforge@gnumonks.org> </div>