1 #include "odu_common_codec.h"
3 /*******************************************************************
5 * @brief Builds PLMN ID
9 * Function : plmnBuildId
11 * Functionality: Building the PLMN ID
13 * @params[in] PLMNID plmn
14 * OCTET_STRING_t *octe
15 * @return ROK - success
18 * ****************************************************************/
19 S16 buildPlmnId(Plmn plmn, OCTET_STRING_t *octe)
23 octe->buf[0] = ((plmn.mcc[1] << 4) | (plmn.mcc[0]));
26 octe->buf[1] = ((0xf0) | (plmn.mcc[2]));
27 octe->buf[2] = ((plmn.mnc[1] << 4) | (plmn.mnc[0]));
31 octe->buf[1] = ((plmn.mnc[0] << 4) | (plmn.mcc[2]));
32 octe->buf[2] = ((plmn.mnc[2] << 4) | (plmn.mnc[1]));
37 /*******************************************************************
39 * @brief Fills the RicId
43 * Function : FillRicId
45 * Functionality: Fills the RicId
47 * @params[in] BIT_STRING_t *nbid,
52 * @return ROK - success
55 * ****************************************************************/
57 S16 fillBitString(BIT_STRING_t *id, U8 unusedBits, U8 byteSize, U8 val)
65 for (tmp = 0 ; tmp < (byteSize-1); tmp++)
69 id->buf[byteSize-1] = val;
70 id->bits_unused = unusedBits;
75 /**********************************************************************
77 **********************************************************************/