From 6f3f3c230cf4384e3f5f35ebfdf6b5e84db38997 Mon Sep 17 00:00:00 2001 From: Alexey Eremin Date: Fri, 28 Feb 2020 18:43:18 +0100 Subject: [PATCH] Bluetooth: Make macro definition compatible with 7-2018-q2-update g++ In C++ designated initializers require that designators used in the expression must appear in the same order as the data members. In addition, 7-2018-q2-update version of g++ doesn't support implicit member initialization, so all members must be initialized. Signed-off-by: Alexey Eremin --- include/bluetooth/bluetooth.h | 1 + include/bluetooth/gatt.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/bluetooth/bluetooth.h b/include/bluetooth/bluetooth.h index b4311f613d4..98c5fe65302 100644 --- a/include/bluetooth/bluetooth.h +++ b/include/bluetooth/bluetooth.h @@ -322,6 +322,7 @@ struct bt_le_adv_param { */ #define BT_LE_ADV_PARAM(_options, _int_min, _int_max) \ ((struct bt_le_adv_param[]) { { \ + .id = BT_ID_DEFAULT, \ .options = (_options), \ .interval_min = (_int_min), \ .interval_max = (_int_max), \ diff --git a/include/bluetooth/gatt.h b/include/bluetooth/gatt.h index b05ff532d62..2acee2adbfe 100644 --- a/include/bluetooth/gatt.h +++ b/include/bluetooth/gatt.h @@ -817,10 +817,11 @@ ssize_t bt_gatt_attr_read_cpf(struct bt_conn *conn, #define BT_GATT_ATTRIBUTE(_uuid, _perm, _read, _write, _value) \ { \ .uuid = _uuid, \ - .perm = _perm, \ .read = _read, \ .write = _write, \ .user_data = _value, \ + .handle = 0, \ + .perm = _perm, \ } /** @brief Notification complete result callback.