LE CoC: Fix disconnection on multiple writes 11/299411/1
authorAnuj Jain <anuj01.jain@samsung.com>
Mon, 4 Apr 2022 12:46:59 +0000 (18:16 +0530)
committerAnuj Jain <anuj01.jain@samsung.com>
Wed, 27 Sep 2023 09:21:42 +0000 (14:51 +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.

To avoid build conflict please merge this patch after merging framework
patch: (Change-Id: Icf4d8a51acc444765a9b61224a3a5d3fd26bfa65)

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

index 49caf93e722af224e9159209e6a7fc2c73d89b7f..db0276b24347a23c2cb91f04c39de5da5d6aed8e 100644 (file)
@@ -6268,12 +6268,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));