laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-pcu/+/32307 )

Change subject: pcu_l1_if: replace magic numbers with IMSI_DIGITS_FOR_PAGING
......................................................................

pcu_l1_if: replace magic numbers with IMSI_DIGITS_FOR_PAGING

we have defined IMSI_DIGITS_FOR_PAGING but some parts of the code still
use magic numbers (3), let's replace those as well.

Change-Id: I9a1b6ba4578e2a8875d8d1a9e56c36dc2b33fe0d
---
M src/pcu_l1_if.cpp
1 file changed, 15 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified




diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index a830c31..85aaddc 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -276,11 +276,12 @@

        /* block provided by upper layer comes without first byte (plen), 
prepend it manually: */
        OSMO_ASSERT(sizeof(data) >= IMSI_DIGITS_FOR_PAGING + 1 + 
block->data_len);
-       data[3] = (plen << 2) | 0x01;
+       data[IMSI_DIGITS_FOR_PAGING] = (plen << 2) | 0x01;
        bitvec_pack(block, data + IMSI_DIGITS_FOR_PAGING + 1);

        if (the_pcu->gsmtap_categ_mask & (1 << PCU_GSMTAP_C_DL_PCH))
-               gsmtap_send(the_pcu->gsmtap, 0, 0, GSMTAP_CHANNEL_PCH, 0, 0, 0, 
0, data + 3, GSM_MACBLOCK_LEN);
+               gsmtap_send(the_pcu->gsmtap, 0, 0, GSMTAP_CHANNEL_PCH, 0, 0, 0, 
0,
+                           data + IMSI_DIGITS_FOR_PAGING, GSM_MACBLOCK_LEN);

        pcu_tx_data_req(bts, 0, 0, PCU_IF_SAPI_PCH, 0, 0, 0, data, 
sizeof(data));
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/32307
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I9a1b6ba4578e2a8875d8d1a9e56c36dc2b33fe0d
Gerrit-Change-Number: 32307
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to