Constructors Summary |
---|
public CellSignalStrengthLte()Empty constructor
setDefaultValues();
|
private CellSignalStrengthLte(android.os.Parcel in)Construct a SignalStrength object from the given parcel
where the token is already been processed.
mSignalStrength = in.readInt();
// rsrp and rsrq are written into the parcel as positive values.
// Need to convert into negative values
mRsrp = in.readInt() * -1;
mRsrq = in.readInt() * -1;
mRssnr = in.readInt();
mCqi = in.readInt();
mTimingAdvance = in.readInt();
if (DBG) log("CellSignalStrengthLte(Parcel): " + toString());
|
public CellSignalStrengthLte(int signalStrength, int rsrp, int rsrq, int rssnr, int cqi, int timingAdvance)Constructor
initialize(signalStrength, rsrp, rsrq, rssnr, cqi, timingAdvance);
|
public CellSignalStrengthLte(CellSignalStrengthLte s)Copy constructors
copyFrom(s);
|
Methods Summary |
---|
public android.telephony.CellSignalStrengthLte | copy()
return new CellSignalStrengthLte(this);
|
protected void | copyFrom(android.telephony.CellSignalStrengthLte s)
mSignalStrength = s.mSignalStrength;
mRsrp = s.mRsrp;
mRsrq = s.mRsrq;
mRssnr = s.mRssnr;
mCqi = s.mCqi;
mTimingAdvance = s.mTimingAdvance;
|
public int | describeContents()Implement the Parcelable interface
return 0;
|
public boolean | equals(java.lang.Object o)
CellSignalStrengthLte s;
try {
s = (CellSignalStrengthLte) o;
} catch (ClassCastException ex) {
return false;
}
if (o == null) {
return false;
}
return mSignalStrength == s.mSignalStrength
&& mRsrp == s.mRsrp
&& mRsrq == s.mRsrq
&& mRssnr == s.mRssnr
&& mCqi == s.mCqi
&& mTimingAdvance == s.mTimingAdvance;
|
public int | getAsuLevel()Get the LTE signal level as an asu value between 0..97, 99 is unknown
Asu is calculated based on 3GPP RSRP. Refer to 3GPP 27.007 (Ver 10.3.0) Sec 8.69
int lteAsuLevel = 99;
int lteDbm = getDbm();
if (lteDbm <= -140) lteAsuLevel = 0;
else if (lteDbm >= -43) lteAsuLevel = 97;
else lteAsuLevel = lteDbm + 140;
if (DBG) log("Lte Asu level: "+lteAsuLevel);
return lteAsuLevel;
|
public int | getDbm()Get signal strength as dBm
return mRsrp;
|
public int | getLevel()Get signal level as an int from 0..4
int levelRsrp = 0;
int levelRssnr = 0;
if (mRsrp == Integer.MAX_VALUE) levelRsrp = 0;
else if (mRsrp >= -95) levelRsrp = SIGNAL_STRENGTH_GREAT;
else if (mRsrp >= -105) levelRsrp = SIGNAL_STRENGTH_GOOD;
else if (mRsrp >= -115) levelRsrp = SIGNAL_STRENGTH_MODERATE;
else levelRsrp = SIGNAL_STRENGTH_POOR;
// See RIL_LTE_SignalStrength in ril.h
if (mRssnr == Integer.MAX_VALUE) levelRssnr = 0;
else if (mRssnr >= 45) levelRssnr = SIGNAL_STRENGTH_GREAT;
else if (mRssnr >= 10) levelRssnr = SIGNAL_STRENGTH_GOOD;
else if (mRssnr >= -30) levelRssnr = SIGNAL_STRENGTH_MODERATE;
else levelRssnr = SIGNAL_STRENGTH_POOR;
int level;
if (mRsrp == Integer.MAX_VALUE)
level = levelRssnr;
else if (mRssnr == Integer.MAX_VALUE)
level = levelRsrp;
else
level = (levelRssnr < levelRsrp) ? levelRssnr : levelRsrp;
if (DBG) log("Lte rsrp level: " + levelRsrp
+ " snr level: " + levelRssnr + " level: " + level);
return level;
|
public int | getTimingAdvance()Get the timing advance value for LTE.
See 3GPP xxxx
return mTimingAdvance;
|
public int | hashCode()
int primeNum = 31;
return (mSignalStrength * primeNum) + (mRsrp * primeNum)
+ (mRsrq * primeNum) + (mRssnr * primeNum) + (mCqi * primeNum)
+ (mTimingAdvance * primeNum);
|
public void | initialize(int lteSignalStrength, int rsrp, int rsrq, int rssnr, int cqi, int timingAdvance)Initialize all the values
mSignalStrength = lteSignalStrength;
mRsrp = rsrp;
mRsrq = rsrq;
mRssnr = rssnr;
mCqi = cqi;
mTimingAdvance = timingAdvance;
|
public void | initialize(SignalStrength ss, int timingAdvance)Initialize from the SignalStrength structure.
mSignalStrength = ss.getLteSignalStrength();
mRsrp = ss.getLteRsrp();
mRsrq = ss.getLteRsrq();
mRssnr = ss.getLteRssnr();
mCqi = ss.getLteCqi();
mTimingAdvance = timingAdvance;
|
private static void | log(java.lang.String s)log
Rlog.w(LOG_TAG, s);
|
public void | setDefaultValues()
mSignalStrength = Integer.MAX_VALUE;
mRsrp = Integer.MAX_VALUE;
mRsrq = Integer.MAX_VALUE;
mRssnr = Integer.MAX_VALUE;
mCqi = Integer.MAX_VALUE;
mTimingAdvance = Integer.MAX_VALUE;
|
public java.lang.String | toString()
return "CellSignalStrengthLte:"
+ " ss=" + mSignalStrength
+ " rsrp=" + mRsrp
+ " rsrq=" + mRsrq
+ " rssnr=" + mRssnr
+ " cqi=" + mCqi
+ " ta=" + mTimingAdvance;
|
public void | writeToParcel(android.os.Parcel dest, int flags)Implement the Parcelable interface
if (DBG) log("writeToParcel(Parcel, int): " + toString());
dest.writeInt(mSignalStrength);
// Need to multiply rsrp and rsrq by -1
// to ensure consistency when reading values written here
dest.writeInt(mRsrp * -1);
dest.writeInt(mRsrq * -1);
dest.writeInt(mRssnr);
dest.writeInt(mCqi);
dest.writeInt(mTimingAdvance);
|