Fix the issue that the data is not fully delivered 89/280489/2
authorWootak Jung <wootak.jung@samsung.com>
Wed, 31 Aug 2022 01:42:03 +0000 (10:42 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Wed, 31 Aug 2022 05:13:51 +0000 (14:13 +0900)
I/BLUETOOTH_FRWK_API( 3421): bt-l2cap-le-client.c: __write_all(542) > written: 122, len 122
I/BLUETOOTH_FRWK_API( 3421): bt-l2cap-le-client.c: __write_all(544) > index 0 : data 79
I/BLUETOOTH_FRWK_API( 3421): bt-l2cap-le-client.c: __write_all(544) > index 1 : data 1a
I/BLUETOOTH_FRWK_API( 3421): bt-l2cap-le-client.c: __write_all(544) > index 2 : data 77
I/BLUETOOTH_FRWK_API( 3421): bt-l2cap-le-client.c: __write_all(544) > index 3 : data 8b
..
I/BLUETOOTH_HAL( 9157): bt-hal-l2cap-le-dbus-handler.c: app_event_cb(255) > len: 3
I/BLUETOOTH_HAL( 9157): bt-hal-l2cap-le-dbus-handler.c: app_event_cb(257) > Received data, index: 0 : 79
I/BLUETOOTH_HAL( 9157): bt-hal-l2cap-le-dbus-handler.c: app_event_cb(257) > Received data, index: 1 : 1a
I/BLUETOOTH_HAL( 9157): bt-hal-l2cap-le-dbus-handler.c: app_event_cb(257) > Received data, index: 2 : 77
D/BLUETOOTH_HAL( 9157): bt-hal-l2cap-le-dbus-handler.c: write_all(191) > len 3
I/BLUETOOTH_HAL( 9157): bt-hal-l2cap-le-dbus-handler.c: write_all(197) > written 3

Change-Id: I4ee146230c0113592a45ad1c39f9bb6bc71cf6b5

bt-oal/bluez_hal/src/bt-hal-l2cap-le-dbus-handler.c

index 4c7667f17933d06f7f72dc3c5c3ac8607478528c..2c1be585a51108b15ee468d9a5f755f847763017 100644 (file)
@@ -401,6 +401,7 @@ static int __new_connection(const char *path, int fd, bt_bdaddr_t *addr)
        io = g_io_channel_unix_new(conn_info->hal_fd);
        conn_info->hal_watch = g_io_add_watch(io, cond, app_event_cb, info);
        g_io_channel_set_flags(io, G_IO_FLAG_NONBLOCK, NULL);
+       g_io_channel_set_encoding(io, NULL, NULL);
        g_io_channel_unref(io);
 
        /* Handle l2cap_le events from bluez */
@@ -408,6 +409,7 @@ static int __new_connection(const char *path, int fd, bt_bdaddr_t *addr)
        io = g_io_channel_unix_new(conn_info->stack_fd);
        conn_info->bt_watch = g_io_add_watch(io, cond, stack_event_cb, info);
        g_io_channel_set_flags(io, G_IO_FLAG_NONBLOCK, NULL);
+       g_io_channel_set_encoding(io, NULL, NULL);
        g_io_channel_unref(io);
 
        return 0;
@@ -891,6 +893,7 @@ int _bt_hal_dbus_handler_l2cap_le_listen(int psm, int *sock)
        io = g_io_channel_unix_new(server_data->server_fd);
        server_data->server_watch = g_io_add_watch(io, cond, __server_event_cb, server_data);
        g_io_channel_set_flags(io, G_IO_FLAG_NONBLOCK, NULL);
+       g_io_channel_set_encoding(io, NULL, NULL);
        g_io_channel_unref(io);
 
        INFO("Adding server information to l2cap_le_servers list");