dexter has uploaded this change for review. ( 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(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/07/32307/1
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 6d48d92..ca3164b 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)); }