Bluetooth: GATT: Make use of Z_STRUCT_SECTION_ITERABLE

This makes use of Z_STRUCT_SECTION_ITERABLE to define static service
sections.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2019-07-01 17:33:08 +03:00 committed by Johan Hedberg
commit 8b9920fd77
3 changed files with 9 additions and 19 deletions

View file

@ -443,8 +443,7 @@ ssize_t bt_gatt_attr_read_service(struct bt_conn *conn,
*/
#define BT_GATT_SERVICE_DEFINE(_name, ...) \
const struct bt_gatt_attr attr_##_name[] = { __VA_ARGS__ }; \
const struct bt_gatt_service_static _name __aligned(4) \
__in_section(_bt_services, static, _name) = \
const Z_STRUCT_SECTION_ITERABLE(bt_gatt_service_static, _name) =\
BT_GATT_SERVICE(attr_##_name)
/** @def BT_GATT_SERVICE