JBSarili
JBSarili

Reputation: 113

How to get eNB id of LTE on Android Studio (TelephonyManager)

Good day,

May I ask how to get the eNB id of CellIdentityLte?

Is there any way of getting it?

Thanks!

Upvotes: 2

Views: 3343

Answers (2)

JBSarili
JBSarili

Reputation: 113

I got it!

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

String cellidHex = Integer.toHexString(longCid);
String eNBHex = cellidHex.substring(0, cellidHex.length()-2);
int eNB = Integer.parseInt(eNBHex, 16);

Explanation: The output of getCi() I convert to HEX, the last two symbols are the hex value of the Local Cell ID and the rest is the hex value of the eNodeB ID. For example 1046022 converted to hex is FF606. eNodeB is FF6 (4086) and Local Cell ID is 06 (6).

Upvotes: 5

theo
theo

Reputation: 11

just use:

identityLte.getCi() >> 8

Upvotes: 0

Related Questions