From 8f0afc235c3adab520797b3c56c57c74165d6285 Mon Sep 17 00:00:00 2001 From: Wootak Jung Date: Wed, 31 Aug 2022 10:42:03 +0900 Subject: [PATCH] Fix the issue that the data is not fully delivered 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bt-oal/bluez_hal/src/bt-hal-l2cap-le-dbus-handler.c b/bt-oal/bluez_hal/src/bt-hal-l2cap-le-dbus-handler.c index 4c7667f..2c1be58 100644 --- a/bt-oal/bluez_hal/src/bt-hal-l2cap-le-dbus-handler.c +++ b/bt-oal/bluez_hal/src/bt-hal-l2cap-le-dbus-handler.c @@ -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"); -- 2.7.4