如何在arduino中定义128位UUID

How to define 128 bit UUID in arduino

我有一个关于如何在 arduino 中定义 BLE 128 位服务 UUID 的问题。

我可以在这样的示例中看到 16 位 UUID:

定义SERVICE_UUID_BATTERY (0x180F)

但是如何在arduino中定义128位的UUID?

谢谢

由于 Arduino 基于 C++,我认为这是不可能的,因为 :

GCC does have an uint128_t/int128_t type, starting from version 4.something (not sure here). I do seem to recall, however, that there was a __int128_t def before that.

Source

不过你可以试着看看这个帖子:Representing 128-bit numbers in C++

也许你可以在 Arduino 中使用这个图书馆...

可以这样定义:

/* 00000000-ABCD-FEED-F00D-012345678900 decided as custom ID. */
uint8_t UUID[] = { 0x00, 0x89, 0x67, 0x45, 0x23, 0x01, 0x0D,0xF0, 0xED, 0xFE,     0xCD, 0xAB, 0x00, 0x00, 0x00, 0x00 };