diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index a072482..fe0be15 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
raw_pdu(0x08, 0x17, 0xf0, 0x17, 0xf0, 0x03, 0x28), \
raw_pdu(0x01, 0x08, 0x17, 0xf0, 0x0a), \
raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), \
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0x12, 0x03, 0x00, 0x29, \
+ raw_pdu(0x09, 0x07, 0x02, 0x00, 0x32, 0x03, 0x00, 0x29, \
0x2a), \
raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), \
raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a)
CHARACTERISTIC_STR(GATT_CHARAC_MANUFACTURER_NAME_STRING,
BT_ATT_PERM_READ,
BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_NOTIFY,
+ BT_GATT_CHRC_PROP_NOTIFY |
+ BT_GATT_CHRC_PROP_INDICATE,
"BlueZ"),
DESCRIPTOR(GATT_CLIENT_CHARAC_CFG_UUID, BT_ATT_PERM_READ |
BT_ATT_PERM_WRITE, 0x00, 0x00),
.length = 0x03,
};
+static uint8_t indication_received;
+
+static void test_indication_cb(void *user_data)
+{
+ struct context *context = user_data;
+
+ indication_received = 1;
+
+ context_quit(context);
+}
+
+static void test_server_indication_confirm(struct context *context)
+{
+ g_assert(indication_received == 1);
+}
+
+static void test_server_indication(struct context *context)
+{
+ const struct test_step *step = context->data->step;
+
+ bt_gatt_server_send_indication(context->server, step->handle,
+ step->value, step->length,
+ test_indication_cb,
+ context, NULL);
+}
+
+static const struct test_step test_indication_server_1 = {
+ .handle = 0x0003,
+ .func = test_server_indication,
+ .post_func = test_server_indication_confirm,
+ .value = read_data_1,
+ .length = 0x03,
+};
+
int main(int argc, char *argv[])
{
struct gatt_db *service_db_1, *ts_small_db, *ts_large_db_1;
ts_small_db, NULL,
raw_pdu(0x03, 0x00, 0x02),
raw_pdu(0x08, 0x01, 0x00, 0x0f, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0x12, 0x03, 0x00, 0x29,
+ raw_pdu(0x09, 0x07, 0x02, 0x00, 0x32, 0x03, 0x00, 0x29,
0x2a),
raw_pdu(0x08, 0x03, 0x00, 0x0f, 0x00, 0x03, 0x28),
raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a));
ts_small_db, NULL,
raw_pdu(0x03, 0x00, 0x02),
raw_pdu(0x08, 0x01, 0x00, 0x0f, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0x12, 0x03, 0x00, 0x29,
+ raw_pdu(0x09, 0x07, 0x02, 0x00, 0x32, 0x03, 0x00, 0x29,
0x2a),
raw_pdu(0x08, 0x03, 0x00, 0x0f, 0x00, 0x03, 0x28),
raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a));
&test_notification_1,
MTU_EXCHANGE_CLIENT_PDUS,
SMALL_DB_DISCOVERY_PDUS,
- raw_pdu(0x12, 0x04, 0x00, 0x01, 0x00),
+ raw_pdu(0x12, 0x04, 0x00, 0x03, 0x00),
raw_pdu(0x13),
raw_pdu(),
raw_pdu(0x1B, 0x03, 0x00, 0x01, 0x02, 0x03));
raw_pdu(),
raw_pdu(0x1B, 0x03, 0x00, 0x01, 0x02, 0x03));
+ define_test_server("/TP/GAI/SR/BV-01-C", test_server, ts_small_db,
+ &test_indication_server_1,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x12, 0x04, 0x00, 0x02, 0x00),
+ raw_pdu(0x13),
+ raw_pdu(),
+ raw_pdu(0x1D, 0x03, 0x00, 0x01, 0x02, 0x03),
+ raw_pdu(0x1E));
+
return g_test_run();
}