我试图通过使用 getGthe 以下编码来获取误码率,但我总是只得到 -1。你们有人知道如何获得有效的误码率吗?请帮助获得正确的值。
代码如下。
public class GetGsmSignalStrengthActivity extends Activity {
TelephonyManager Tel;
MyPhoneStateListener MyListener;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Tel = ( TelephonyManager )getSystemService(Context.TELEPHONY_SERVICE);
Tel.listen(MyListener ,PhoneStateListener.LISTEN_SIGNAL_STRENGTHS);
}
private class MyPhoneStateListener extends PhoneStateListener
{
@Override
public void onSignalStrengthsChanged(SignalStrength signalStrength)
{
super.onSignalStrengthsChanged(signalStrength);
TextView dummy1 = (TextView)findViewById(R.id.textView5);
String x,m ="";
x=String.valueOf(signalStrength.getGsmBitErrorRate());
dummy4.setText("Bit Error : " +x);
}
}
}
最佳答案
阅读此内容 bug report comment #4 。您会发现它是可选的,因此是可能的。如果调制解调器制造商没有提供,它将返回-1。
引用:
The problem is that AT+CSQ in TS 27.007 section 8.5 is listed as optional. Therefore the modem manufacturer has the choice whether or not to provide both the signal and bit error rate using standard interfaces. So when you see -1 that means the modem people haven't implemented it.
关于android - 如何获得有效的误码率或接收质量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9066586/