[android-SignalStrength]
来源:互联网 发布:淘宝特卖9.9 编辑:程序博客网 时间:2024/06/18 13:44
一.根据3GPP TS 27.007 8.5 协议规定也就是ASU 是底层直接返回协议数据规定如下
{
rssi:interger type
0-113 dBm or less
1-111 dBm
2-30-53dBm
31-51dBm or greater
99not know or not detectable
}
二.SignalStrength 通过如上RSSI 也就是ASU 来判断级别
public int getGsmLevel() {
int level;
/ ASU ranges from 0 to 31 - TS 27.007 Sec 8.5
/ asu = 0 (-113dB or less) is very weak
/ signal, its better to show 0 bars to the user in such cases.
/ asu = 99 is a special case, where the signal strength is unknown. int asu = getGsmSignalStrength();
/*
dBm与 RSSI转换公式:dBm=-113 + (2 * asu); */
if (asu <= 2 || asu == 99) level = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;<=-109dBm,==85dBm
else if (asu >= 12) level = SIGNAL_STRENGTH_GREAT;>=-89dBm
else if (asu >= 8) level = SIGNAL_STRENGTH_GOOD;>-97dBm
else if (asu >= 5) level = SIGNAL_STRENGTH_MODERATE;>=-103dBm
else level = SIGNAL_STRENGTH_POOR; if (DBG) log("getGsmLevel=" + level); return level;
}
三.SignalStrength 通过如下接口供上层根据 ASU 转换成dBm
/**
* Return current signal strength in "dBm", ranging from -113 - -51dBm
* or -1 if unknown
*
* @return signal strength in dBm, -1 if not yet updated
* Throws RuntimeException if client has not called notifySignalStrength()
*/
public int getSignalStrengthDbm() {
if ((mWants & NOTIF_SIGNAL) == 0) { throw new RuntimeException
("client must call notifySignalStrength(int)");
}
return mSignalStrength.getDbm();
}
public int getGsmDbm() { int dBm;
int gsmSignalStrength = getGsmSignalStrength();
int asu = (gsmSignalStrength == 99 ? -1 : gsmSignalStrength); if (asu != -1) {
dBm = -113 + (2 * asu);
} else { dBm = -1;
}
if (DBG) log("getGsmDbm=" + dBm); return dBm;
}
- [android-SignalStrength]
- Android network的Type和 phone的signalStrength
- Android
- android
- Android
- android
- android
- Android
- Android
- android
- android
- android
- Android
- Android
- android!!!
- android
- android
- android
- (最易理解)51Nod
- 背包问题: HDU1114Piggy-Bank
- LVS系列—负载均衡之工作原理说明(NAT模式)
- Array 【思维】水
- ReactNative朋友圈API设计
- [android-SignalStrength]
- Linux下C和matlab混合编程学习(1)
- codeforces #433C Ryouko's Memory Note
- 硅谷之谜-工程师的五个等级
- hdu1698 Just a Hook 线段树区间更新,模板题
- JS 中几种获得节点元素的方法
- centos 依赖包安装
- 面试过程是这样的
- js-正则表达式(下)