蓝牙广播中对服务 UUID 格式定义都有三种 16 bit UUID、32 bit UUID、128 bit UUID。

但是熟悉安卓开发的小伙伴都知道接口都 UUID 格式,fromString 时候 16bit 的 UUID 该咋办呢?

16bit 和 32bit 的 UUID 与 128bit 的值之间转换关系:

128_bit_UUID = 16_bit_UUID * 2^96 + Bluetooth_Base_UUID

128_bit_UUID = 32_bit_UUID * 2^96 + Bluetooth_Base_UUID

其中 Bluetooth_Base_UUID 定义为 00000000-0000-1000-8000-00805F9B34FB 

如果你想说这是啥呀,那我这样说你应该可以明白点:

若 16 bit UUID为xxxx,那么 128 bit UUID 为 0000xxxx-0000-1000-8000-00805F9B34FB

若 32 bit UUID为xxxxxxxx,那么 128 bit UUID 为 xxxxxxxx-0000-1000-8000-00805F9B34FB

相关文章:

  • 2022-12-23
  • 2021-09-01
  • 2021-07-29
  • 2022-12-23
  • 2021-12-06
  • 2021-12-29
  • 2022-01-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-06-12
  • 2021-11-14
相关资源
相似解决方案