UTRAN cell identifier returned by getCid ()

In UMTS, I get a large number returned getCid()(more than a valid value). Is this a UTRAN cell identifier (UC-ID)?

UC-Id = RNC-Id + C-Id

Does anyone know this? How to get C-Idout UC-Id?

Thanks and better Benny

+5
source share
4 answers

The RNC identifier is the first 2 bytes of the 4-byte cell identifier (3GPP 25.401, Section 6.1.5) if the network type is UMTS / HSxPA / HSPA +.
I have access to the operator’s network and I checked in the system, and this is true and correct.
Based on this, please see my code, how you can easily get RNCID + CID:
Converting CID to ByteArray:

    public static byte[] convertByteArray__p(int p_int){
    byte[] l_byte_array = new byte[4];
    int MASK_c = 0xFF;
    for (short i=0; i<=3; i++){
        l_byte_array[i] = (byte) ((p_int >> (8*i)) & MASK_c);
    }
    return l_byte_array;
} 


RNCID CID:

    public int getRNCID_or_CID__p(byte[] p_bytes, short p_which){
    int MASK_c = 0xFF;
    int l_result = 0;   
    if (p_which == Constants.CID_C) {
        l_result = p_bytes[0] & MASK_c ;
        l_result = l_result + ((p_bytes[1] & MASK_c ) << 8);
    } else if (p_which == Constants.RNCID_C){
        l_result = p_bytes[2] & MASK_c ;
        l_result = l_result + ((p_bytes[3] & MASK_c ) << 8);
    } else { 
        g_FileHandler.putLog__p('E', "getRNCID_or_CID__p invalid parameter");
    }
    return l_result;     
}


:

        byte[] l_byte_array = new byte[4];
        l_byte_array = convertByteArray__p(l_cid);
        int l_RNC_ID   = getRNCID_or_CID__p(l_byte_array,Constants.RNCID_C);
        int l_real_CID = getRNCID_or_CID__p(l_byte_array,Constants.CID_C);


RNCID_C (1) CID_C (2) , , .

+6

( % 65536) .

+3

, . getCid(), RNC (http://developer.android.com/reference/android/telephony/gsm/GsmCellLocation.html#getCid()). :

getCid() == RNC < 16 | CID

CID = getCid() 0xffff

RNC = (getCid() → 16) 0xffff

+2

CID > 65536, , RNC-ID:

UTRAN_CELL_ID = RNCID x 65536 + CellID

CellID, modulo:

CellID = UTRAN_CELL_ID % 65536

To extract the RNCID, get the integer part:

RNCID = UTRAN_CELL_ID / 65536
+2
source

All Articles