2017-04-01 32 views

回答

1

我明白了!

    final CellIdentityLte identityLte = ((CellInfoLte) info).getCellIdentity(); 
        int longCid = identityLte.getCi(); 

        String cellidHex = DecToHex(longCid); 
        String eNBHex = cellidHex.substring(0, cellidHex.length()-2); 

        int eNB = HexToDec(eNBHex); 

        return checkValidString(Integer.toString(eNB)); 

使用此方法...

// Decimal -> hexadecimal 
public String DecToHex(int dec){ 
    return String.format("%x", dec); 
} 

// hex -> decimal 
public int HexToDec(String hex){ 
    return Integer.parseInt(hex, 16); 
} 
+0

正是我一直在尋找的。我測試了它,這是真的。 getCi()的輸出轉換爲HEX,最後兩個符號爲本地小區ID的HEX值,其餘爲eNodeB ID的HEX值。例如,轉換爲HEX的1046022是FF606。 eNodeB爲FF6 - > 4086,本地小區ID爲06 - > 6.完全按照我連接的LTE小區配置。 – vladiz

-1

只需使用:

identityLte.getCi() >> 8 
+0

這不提供問題的答案。一旦你有足夠的[聲譽](https://stackoverflow.com/help/whats-reputation),你將可以[對任何帖子發表評論](https://stackoverflow.com/help/privileges/comment);相反,[提供不需要提問者澄清的答案](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-c​​an- I-DO-代替)。 - [來自評論](/ review/low-quality-posts/16855816) –

相關問題