diff --git a/android/tester-gatt.c b/android/tester-gatt.c
index 38dfe42..1c0397e 100644
--- a/android/tester-gatt.c
+++ b/android/tester-gatt.c
step->callback = CB_EMU_VALUE_INDICATION;
schedule_callback_verification(step);
- break;
+ goto respond;
case L2CAP_ATT_HANDLE_VALUE_NOTIFY:
step = g_new0(struct step, 1);
break;
}
+respond:
if (memcmp(gatt_pdu->iov_base, data, len)) {
tester_print("Incoming data mismatch");
break;
ACTION_SUCCESS(gatt_server_send_indication_action,
&send_indication_data_1),
CALLBACK(CB_EMU_VALUE_INDICATION),
+ CALLBACK_GATTS_NOTIF_CONF(CONN1_ID, GATT_STATUS_SUCCESS),
ACTION_SUCCESS(bluetooth_disable_action, NULL),
CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
),
CONN1_ID, APP1_ID),
ACTION_SUCCESS(gatt_server_send_indication_action,
&send_indication_data_2),
+ CALLBACK_GATTS_NOTIF_CONF(CONN1_ID, GATT_STATUS_SUCCESS),
CALLBACK(CB_EMU_VALUE_NOTIFICATION),
ACTION_SUCCESS(bluetooth_disable_action, NULL),
CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_OFF),
diff --git a/android/tester-main.c b/android/tester-main.c
index c13f056..2506548 100644
--- a/android/tester-main.c
+++ b/android/tester-main.c
DBG_CB(CB_GATTS_REQUEST_WRITE),
DBG_CB(CB_GATTS_REQUEST_EXEC_WRITE),
DBG_CB(CB_GATTS_RESPONSE_CONFIRMATION),
+ DBG_CB(CB_GATTS_INDICATION_SEND),
/* Map client */
DBG_CB(CB_MAP_CLIENT_REMOTE_MAS_INSTANCES),
schedule_callback_verification(step);
}
+static void gatts_indication_send_cb(int conn_id, int status)
+{
+ struct step *step = g_new0(struct step, 1);
+
+ step->callback = CB_GATTS_INDICATION_SEND;
+
+ step->callback_result.conn_id = conn_id;
+ step->callback_result.status = status;
+
+ schedule_callback_verification(step);
+}
+
static const btgatt_server_callbacks_t btgatt_server_callbacks = {
.register_server_cb = gatts_register_server_cb,
.connection_cb = gatts_connection_cb,
.request_read_cb = gatts_request_read_cb,
.request_write_cb = gatts_request_write_cb,
.request_exec_write_cb = NULL,
- .response_confirmation_cb = NULL
+ .response_confirmation_cb = NULL,
+ .indication_sent_cb = gatts_indication_send_cb,
+ .congestion_cb = NULL,
};
static const btgatt_callbacks_t btgatt_callbacks = {
diff --git a/android/tester-main.h b/android/tester-main.h
index 3d97b72..8a7384c 100644
--- a/android/tester-main.h
+++ b/android/tester-main.h
.callback_result.gatt_app_id = cb_server_id, \
}
+#define CALLBACK_GATTS_NOTIF_CONF(cb_conn_id, cb_status) { \
+ .callback = CB_GATTS_INDICATION_SEND, \
+ .callback_result.conn_id = cb_conn_id, \
+ .callback_result.status = cb_status, \
+ }
+
#define CALLBACK_GATTS_SERVICE_ADDED(cb_res, cb_server_id, cb_service, \
cb_srvc_handle, \
cb_store_srvc_handle) { \
CB_GATTS_REQUEST_WRITE,
CB_GATTS_REQUEST_EXEC_WRITE,
CB_GATTS_RESPONSE_CONFIRMATION,
+ CB_GATTS_INDICATION_SEND,
/* Map client */
CB_MAP_CLIENT_REMOTE_MAS_INSTANCES,