【发布时间】:2016-05-06 13:35:33
【问题描述】:
我使用带有蓝牙加密狗的树莓派来模拟信标。当我在树莓中更改信标时,我想测量移动应用程序检测信标的 UUID 所需的时间。通过这段代码,我找到了智能手机用来同步磁贴的服务器
final Resources res = this.getResources();
final int id = Resources.getSystem().getIdentifier(
"config_ntpServer", "string","android");
final String defaultServer = res.getString(id);
比我用
同步树莓派中的时间sudo ntpdate -u 2.android.pool.ntp.org
在更改信标的 ID 之前,我会打印时间
timestamp() {
date +"%T,%3N"
}
timestamp # print timestamp
sudo hcitool -i hci0 cmd 0x08 0x0008 1e 02 01 1.....
然后我比较了我更改UUID的时间和第一次看到UUID时logcat中的时间,结果总是否定的 UUID 在 15:33:03,276 更改并在 15:33:02.301 检测到。
这是同步问题吗?有没有更好的方法来做到这一点?
【问题讨论】:
标签: linux raspberry-pi ibeacon ibeacon-android ntpd