蓝牙RSSI值总是以dBm在所有的Andr​​oid设备? [英] Bluetooth RSSI values are always in dBm in all Android devices?

查看:110
本文介绍了蓝牙RSSI值总是以dBm在所有的Andr​​oid设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Andr​​oid和我的应用程序使用蓝牙从一个小的力传感器放大器接收数据。而在某些设备(三星的)对BT信号强度(RSSI)变化如预期(从大约-20,在短距离,以围绕-80,以10m),在一些其他(一个LG模型,至少)将RSSI相当怪异,周围200(正值!)在很短的距离。我假设LG手机没有以dBm给RSSI值。在所有情况下的三星平板电脑和LG手机总是连接到相同的远程设备(即我的客户正在开发放大器样品)。其实我的问题是,如果是正常的,在这种情况下,不同的Andr​​oid设备(或不同的Andr​​oid版本)回答不同,以相同的API调用。

I'm new to Android and my app uses Bluetooth to receive data from a small load cell amplifier. While in some devices (Samsung ones) the BT signal strength (RSSI) vary as expected (from around -20, at short distance, to around -80, at 10m), in some others (one LG model, at least) the RSSI are quite weird, as around 200 (positive value!) at short distance. I'm supposing that LG phone is not giving RSSI values in dBm. In all cases Samsung tablets and LG phones were always connected to the same remote device (the amplifier sample that my customer is developing). Actually my question is if it is normal, in this case, that different Android devices (or different Android versions) answer differently to the same API call.

推荐答案

RSSI的是一个8位有符号二进制补码整数(-128〜127)。
如果你读了值作为一个字节,那么你会得到任何设备的正确值范围。
如果你读它作为一个整数或字符串,你可能最终在某些设备上正确的价值观不正确,但在其它一些...

The RSSI is an 8-bit signed two's complement integer(-128 to 127). If you read the value as a byte then you will get the correct value range for any device. If you read it as an integer or a string you might end up with correct values on some devices but incorrect on some other...

200为8位有符号二进制补码整数等于-56

200 as an 8-bit signed two's complement integer equals -56

这篇关于蓝牙RSSI值总是以dBm在所有的Andr​​oid设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆