X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcodec_utils%2Fcommon%2Fodu_common_codec.c;h=5ea3c8da6e0e8552e7d024818785b2a922a5d040;hb=9634ca974c4418c0800090e33d37ef1fe7e8cb30;hp=9e7693c368e7f1f27475ba86b19534323ac5699c;hpb=aee73991f728cc127d1ed76d5a52571d916235a4;p=o-du%2Fl2.git diff --git a/src/codec_utils/common/odu_common_codec.c b/src/codec_utils/common/odu_common_codec.c index 9e7693c36..5ea3c8da6 100644 --- a/src/codec_utils/common/odu_common_codec.c +++ b/src/codec_utils/common/odu_common_codec.c @@ -28,40 +28,6 @@ int PrepFinalEncBuf(const void *buffer, size_t size, void *encodedBuf) return 0; } /* PrepFinalEncBuf */ -/******************************************************************* - * - * @brief Builds PLMN ID - * - * @details - * - * Function : plmnBuildId - * - * Functionality: Building the PLMN ID - * - * @params[in] PLMNID plmn - * OCTET_STRING_t *octe - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ -uint8_t buildPlmnId(Plmn plmn, OCTET_STRING_t *octe) -{ - uint8_t mncCnt; - mncCnt = 2; - octe->buf[0] = ((plmn.mcc[1] << 4) | (plmn.mcc[0])); - if(mncCnt == 2) - { - octe->buf[1] = ((0xf0) | (plmn.mcc[2])); - octe->buf[2] = ((plmn.mnc[1] << 4) | (plmn.mnc[0])); - } - else - { - octe->buf[1] = ((plmn.mnc[0] << 4) | (plmn.mcc[2])); - octe->buf[2] = ((plmn.mnc[2] << 4) | (plmn.mnc[1])); - } - return ROK; -} - /******************************************************************* * * @brief Fills the RicId @@ -115,15 +81,22 @@ uint8_t fillBitString(BIT_STRING_t *id, uint8_t unusedBits, uint8_t byteSize, ui * RFAILED - failure * * ****************************************************************/ -uint8_t bitStringToInt(BIT_STRING_t *bitString, uint16_t *val) +uint8_t bitStringToInt(BIT_STRING_t *bitString, void *value) { uint16_t idx; + uint32_t *val = NULLP; + if(bitString->buf == NULL || bitString->size <= 0) { DU_LOG("\nDU_APP : Bit string is empty"); return RFAILED; } + if(value) + val = (uint32_t *)value; + else + return RFAILED; + for(idx=0; idx< bitString->size-1; idx++) { *val |= bitString->buf[idx];