Fix gatt send response logic 96/270796/1 accepted/tizen/unified/20220210.105859 submit/tizen/20220209.062549
authorWootak Jung <wootak.jung@samsung.com>
Wed, 9 Feb 2022 06:11:46 +0000 (15:11 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Wed, 9 Feb 2022 06:14:59 +0000 (15:14 +0900)
no need to send response if response_need false

Change-Id: I23f524212fa0dab76b73a17299f3bc85bb75ac5b

tests/test/bt_unit_test.c

index 2516fb4..f74ccc2 100644 (file)
@@ -2911,9 +2911,10 @@ void __bt_gatt_server_write_value_requested_cb(const char *remote_address,
        for (i = 0; i < len; i++)
                printf("%d ", value[i]);
 
-       bt_gatt_server_send_response(request_id,
-       BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE, offset,
-               resp_status, NULL, 0);
+       if (response_needed)
+               bt_gatt_server_send_response(request_id,
+                       BLUETOOTH_GATT_ATT_REQUEST_TYPE_WRITE, offset,
+                       resp_status, NULL, 0);
 
        printf("\n");
 }