diff --git a/unit/test-vcp.c b/unit/test-vcp.c
index ea1bc98..2a08dca 100644
--- a/unit/test-vcp.c
+++ b/unit/test-vcp.c
struct bt_att *att, void *user_data)
{
struct test_data *data = user_data;
- struct notify notify;
-
- memset(¬ify, 0, sizeof(notify));
-
- notify.handle = gatt_db_attribute_get_handle(attrib);
- notify.ccc_handle = gatt_db_attribute_get_handle(ccc);
- notify.value = (void *) value;
- notify.len = len;
+ uint16_t handle = gatt_db_attribute_get_handle(attrib);
if (!bt_gatt_server_send_notification(data->server,
- notify.handle, notify.value,
- notify.len, false))
+ handle, value, len, false))
printf("%s: Failed to send notification\n", __func__);
}
struct ccc_state *ccc;
uint16_t handle;
uint8_t ecode = 0;
- const uint8_t *value = NULL;
- size_t len = 0;
+ uint16_t value = 0;
handle = gatt_db_attribute_get_handle(attrib);
goto done;
}
- len = sizeof(ccc->value);
- value = (void *) &ccc->value;
+ value = cpu_to_le16(ccc->value);
done:
- gatt_db_attribute_read_result(attrib, id, ecode, value, len);
+ gatt_db_attribute_read_result(attrib, id, ecode, (void *)&value,
+ sizeof(value));
}
static void test_server(const void *user_data)