我正在尝试更改estimote信标的UUID并且没有为此找到特定的API,任何人都有任何示例或帮助?
答案 0 :(得分:1)
在这里,对于proximityUUID,它是相同的,但您必须将writeMajor
更改为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();
}
答案 1 :(得分:0)
您可以使用BeaconConnection
类的writeProximityUuid方法。