Turn standard 4 bit UUID into 2 16 bit UUIDs

I am writing a program for a Garmin Edge which needs to connect to a power meter via Bluetooth, some of the characteristic / service UUIDs are 4 digits which cannot be used when coding for Garmin products. For example, this is the code to connect to one of the services vis Bluetooth:

public const POWER_METER_UART_SERVICE      = BluetoothLowEnergy.longToUuid(0x6E****************, 0xE0****************);

Is there anyway to convert these 4 bit UUIDs so they would be compatible with this format? 

Thanks

Parents Reply
  • Hi,

    The same applies to all UUIDs. Service UUIDs and characteristic UUIDs alike. As long as it is a Bluetooth SIG 16 bit UUID, that is the way to convert it to a 128 bit UUID, using that base UUID that I mentioned.

    Please note that byte endianness might trip you off, so you might have to consider byte (and bit) ordering. However, if it works for one type of UUID, it should work for all of them.

    Regards,
    Terje

Children
Related