From a980d1569eaf1074f728fc1c41d6a85e58c1f5af Mon Sep 17 00:00:00 2001 From: Jakub Tyszkowski Date: Fri, 13 Feb 2015 14:17:40 +0100 Subject: android/tester: Add test for GATT server app indication confirmation This adds checking if sent indication or notification has been confirmed over HAL. --- android/tester-main.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'android/tester-main.c') diff --git a/android/tester-main.c b/android/tester-main.c index c13f056d7..25065482f 100644 --- a/android/tester-main.c +++ b/android/tester-main.c @@ -121,6 +121,7 @@ static struct { 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), @@ -2000,6 +2001,18 @@ static void gatts_request_write_cb(int conn_id, int trans_id, bt_bdaddr_t *bda, 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, @@ -2013,7 +2026,9 @@ static const btgatt_server_callbacks_t btgatt_server_callbacks = { .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 = { -- cgit v1.2.1