LE CoC: Fix disconnection on multiple writes 42/273342/1
authorAnuj Jain <anuj01.jain@samsung.com>
Mon, 4 Apr 2022 12:46:59 +0000 (18:16 +0530)
committerAnuj Jain <anuj01.jain@samsung.com>
Mon, 4 Apr 2022 13:06:30 +0000 (18:36 +0530)
This patch fixes the the issue of LE_L2CAP socket disconnection
when write operation is performed more than once by either client or
server.

Change-Id: I6bd2e7fdbfe8ba1931d4a141266da8c902deb228
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
tests/test/bt_unit_test.c

index 9f7299d..e2ba197 100644 (file)
@@ -6237,12 +6237,12 @@ int test_input_callback(void *data)
                        if (g_test_param.param_count > 0) {
                                ret = bt_socket_send_data_l2cap_channel(l2cap_le_client_fd,
                                        g_test_param.params[0],
-                                       strlen(g_test_param.params[0]) + 1);
+                                       strlen(g_test_param.params[0]));
 
                                __bt_free_test_param(&g_test_param);
                        } else {
                                ret = bt_socket_send_data_l2cap_channel(l2cap_le_client_fd,
-                                       data, sizeof(data));
+                                       data, strlen(data));
                        }
 
                        TC_PRT("returns %d %s\n", ret, __bt_get_error_message(ret));