我正在尝试更改 estimote 信标的 UUID,但尚未找到特定的 API,有人有任何示例或帮助吗?
问问题
442 次
2 回答
1
在这里,proximityUUID 相同,但您必须更改writeMajor
by writeProximityUuid
。
private void setMajorID(final int majorid,final Beacon beacon) {
mMajorsConnection = new BeaconConnection(this, beacon, new BeaconConnection.ConnectionCallback() {
@Override
public void onAuthenticated(BeaconConnection.BeaconCharacteristics chars) {
Log.d(TAG, "Authenticated to beacon: " + chars);
mMajorsConnection.writeMajor(majorid, new BeaconConnection.WriteCallback() {
@Override
public void onSuccess() {
runOnUiThread(new Runnable() {
@Override
public void run() {
mAdapter.update(beacon);
}
});
Log.d(TAG, "Successfully writted the major id!");
mMajorsConnection.close();
}
@Override
public void onError() {
Log.d(TAG, "Error while writting the major id!");
}
});
}
@Override
public void onAuthenticationError() {
Log.d(TAG, "Authentication Error");
}
@Override
public void onDisconnected() {
Log.d(TAG, "Disconnected");
}
});
mMajorsConnection.authenticate();
}
于 2015-03-31T15:17:00.857 回答
0
您可以使用该类的writeProximityUuid方法BeaconConnection
。
于 2015-01-13T16:33:56.710 回答