From 6353155771e1de9d1cd619b97fbe86e1265a5d59 Mon Sep 17 00:00:00 2001 From: Christopher Collins Date: Fri, 24 Jun 2016 17:00:15 -0700 Subject: BLE Host - Const correctness. --- net/nimble/host/src/test/ble_gatt_find_s_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/nimble/host/src/test/ble_gatt_find_s_test.c') diff --git a/net/nimble/host/src/test/ble_gatt_find_s_test.c b/net/nimble/host/src/test/ble_gatt_find_s_test.c index dca1f367..3e190a67 100644 --- a/net/nimble/host/src/test/ble_gatt_find_s_test.c +++ b/net/nimble/host/src/test/ble_gatt_find_s_test.c @@ -46,8 +46,8 @@ ble_gatt_find_s_test_misc_init(void) static int ble_gatt_find_s_test_misc_cb(uint16_t conn_handle, - struct ble_gatt_error *error, - struct ble_gatt_svc *service, + const struct ble_gatt_error *error, + const struct ble_gatt_svc *service, void *arg) { TEST_ASSERT(!ble_gatt_find_s_test_proc_complete); -- cgit v1.2.3 From 079aff14eafdec45d0aab5a7874d8ec35df6826e Mon Sep 17 00:00:00 2001 From: Christopher Collins Date: Wed, 29 Jun 2016 12:39:45 -0700 Subject: BLE Host - GATT client cb: error arg never null. Prior to this change, the GATT client indicated success by passing a null error argument to the application callback. This made it unnecessarily difficult for application code, because it would always have to check error for null before looking at its status field. Now, the error argument is never null. Success is indicated by setting error->status = 0. --- net/nimble/host/src/test/ble_gatt_find_s_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/nimble/host/src/test/ble_gatt_find_s_test.c') diff --git a/net/nimble/host/src/test/ble_gatt_find_s_test.c b/net/nimble/host/src/test/ble_gatt_find_s_test.c index 3e190a67..d9eb0e82 100644 --- a/net/nimble/host/src/test/ble_gatt_find_s_test.c +++ b/net/nimble/host/src/test/ble_gatt_find_s_test.c @@ -51,7 +51,7 @@ ble_gatt_find_s_test_misc_cb(uint16_t conn_handle, void *arg) { TEST_ASSERT(!ble_gatt_find_s_test_proc_complete); - TEST_ASSERT(error == NULL); + TEST_ASSERT(error != NULL && error->status == 0); if (service == NULL) { ble_gatt_find_s_test_proc_complete = 1; -- cgit v1.2.3 From 2447ea0e1e24859073babda8094d7547cf5df6e6 Mon Sep 17 00:00:00 2001 From: Christopher Collins Date: Wed, 29 Jun 2016 14:13:54 -0700 Subject: BLE Host - Indicate GATT proc done - BLE_HS_EDONE --- net/nimble/host/src/test/ble_gatt_find_s_test.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'net/nimble/host/src/test/ble_gatt_find_s_test.c') diff --git a/net/nimble/host/src/test/ble_gatt_find_s_test.c b/net/nimble/host/src/test/ble_gatt_find_s_test.c index d9eb0e82..cf988d6f 100644 --- a/net/nimble/host/src/test/ble_gatt_find_s_test.c +++ b/net/nimble/host/src/test/ble_gatt_find_s_test.c @@ -51,12 +51,20 @@ ble_gatt_find_s_test_misc_cb(uint16_t conn_handle, void *arg) { TEST_ASSERT(!ble_gatt_find_s_test_proc_complete); - TEST_ASSERT(error != NULL && error->status == 0); + TEST_ASSERT(error != NULL); - if (service == NULL) { - ble_gatt_find_s_test_proc_complete = 1; - } else { + switch (error->status) { + case 0: ble_gatt_find_s_test_svcs[ble_gatt_find_s_test_num_svcs++] = *service; + break; + + case BLE_HS_EDONE: + ble_gatt_find_s_test_proc_complete = 1; + break; + + default: + TEST_ASSERT(0); + break; } return 0; -- cgit v1.2.3 From ef7abf7d06e4cbf90f0e11c0762ee83d7b5a5add Mon Sep 17 00:00:00 2001 From: Christopher Collins Date: Fri, 22 Jul 2016 12:02:37 -0700 Subject: BLE Host - Use mbufs instead of flat bufs. --- net/nimble/host/src/test/ble_gatt_find_s_test.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'net/nimble/host/src/test/ble_gatt_find_s_test.c') diff --git a/net/nimble/host/src/test/ble_gatt_find_s_test.c b/net/nimble/host/src/test/ble_gatt_find_s_test.c index cf988d6f..c3ab93df 100644 --- a/net/nimble/host/src/test/ble_gatt_find_s_test.c +++ b/net/nimble/host/src/test/ble_gatt_find_s_test.c @@ -328,6 +328,8 @@ TEST_CASE(ble_gatt_find_s_test_1) TEST_SUITE(ble_gatt_find_s_test_suite) { + tu_suite_set_post_test_cb(ble_hs_test_util_post_test, NULL); + ble_gatt_find_s_test_1(); } -- cgit v1.2.3