Search code examples
androidestimotebeacon

get UUID, Major, Minor from Estimote Connection


I've been unable to find in the documentation of Estimote how to get the UUID, Major or Minor once I established a connection with the beacon.

connectionProvider.connectToService(new DeviceConnectionProvider.ConnectionProviderCallback() {
            @Override
            public void onConnectedToService() {
                connection = connectionProvider.getConnection(configurableDevice);
                connection.connect(new DeviceConnectionCallback() {
                    @Override
                    public void onConnected() {
                    String UUID=connection.settings.beacon.proximityUUID().toString();
}}}

This code returns a DeviceSetting but I cannot find where the UUID variable is. Has anyone been able to figure this out? I need to check the UUID, Major and Minor to see if the Estimote Location Beacon is already registered in my server.


Solution

  • proximityUUID() returns a DeviceSetting<UUID>, so you will have to ask for the value using get. Try the following (not tested):

    // ds is a DeviceSetting<UUID> instance
    ds.get(new SettingCallback<UUID>() {
        @Override
        void onSuccess(UUID value) {
            // There it is    
        }
        @Override
        void onFailure(DeviceConnectionException e) {
        }
    })