Bluetooth: rework to support C++20 designated initializers

C++ does not allow chaining of data members when identifying the
designator.  Since the generic structure has only one member remove
the designator from its internal initializer.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
Peter A. Bigot 2019-11-01 11:07:53 -05:00 committed by Anas Nashif
commit bf5817d273
3 changed files with 5 additions and 5 deletions

View file

@ -52,19 +52,19 @@ struct bt_uuid_128 {
#define BT_UUID_INIT_16(value) \
{ \
.uuid.type = BT_UUID_TYPE_16, \
.uuid = { BT_UUID_TYPE_16 }, \
.val = (value), \
}
#define BT_UUID_INIT_32(value) \
{ \
.uuid.type = BT_UUID_TYPE_32, \
.uuid = { BT_UUID_TYPE_32 }, \
.val = (value), \
}
#define BT_UUID_INIT_128(value...) \
{ \
.uuid.type = BT_UUID_TYPE_128, \
.uuid = { BT_UUID_TYPE_128 }, \
.val = { value }, \
}

View file

@ -23,7 +23,7 @@
* big endian 0x2800 : [28 00] -> swapping required
*/
static const struct bt_uuid_128 uuid128_base = {
.uuid.type = BT_UUID_TYPE_128,
.uuid = { BT_UUID_TYPE_128 },
.val = { BT_UUID_128_ENCODE(
0x00000000, 0x0000, 0x1000, 0x8000, 0x00805F9B34FB) }
};

View file

@ -167,7 +167,7 @@ int bt_mesh_prov_enable(bt_mesh_prov_bearer_t bearers)
if (IS_ENABLED(CONFIG_BT_DEBUG)) {
const struct bt_mesh_prov *prov = bt_mesh_prov_get();
struct bt_uuid_128 uuid = { .uuid.type = BT_UUID_TYPE_128 };
struct bt_uuid_128 uuid = { .uuid = { BT_UUID_TYPE_128 } };
memcpy(uuid.val, prov->uuid, 16);
BT_INFO("Device UUID: %s", bt_uuid_str(&uuid.uuid));