Skip to content Skip to sidebar Skip to footer

How To Extract Latitude And Longitude From Location_and_speed Characteristic?

In an Android app in central role - how do you please get a hold of the latitude and longitude stored in the org.bluetooth.characteristic.location_and_speed characteristic in the o

Solution 1:

Although I think it won't work for a read you need a notify.

            UUID CCCD = UUID.fromString("00002902-0000-1000-8000-00805f9b34fb");
            mVehicleInfoService = bluetoothGatt.getService(LOCATION_AND_NAVIGATION);
            mLocationAndSpeedChar = mVehicleInfoService.getCharacteristic(LOCATION_AND_SPEED);
            bluetoothGatt.setCharacteristicNotification(mLocationAndSpeedChar,true);
            BluetoothGattDescriptor descriptor = mLocationAndSpeedChar.getDescriptor(CCCD);
            descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
            bluetoothGatt.writeDescriptor(descriptor);

Post a Comment for "How To Extract Latitude And Longitude From Location_and_speed Characteristic?"