Fix remote device address in connectionStateChangedCb 66/286066/1
authorAyush Garg <ayush.garg@samsung.com>
Mon, 26 Dec 2022 10:12:49 +0000 (15:42 +0530)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 26 Dec 2022 10:12:49 +0000 (15:42 +0530)
This patch will fill the correct remote address in the
connectionStateChangedCb when the socket connection got failed.

Change-Id: I1d468408b6e3afca3f26e3935cc9bb84de7af43f
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
bt-service/services/bt-request-handler.c

index 1733cf8f4c4a3f093501470fb1f8d881eb543a5b..9b5d5b2658c2744a65898041b61f3ad225b820dc 100644 (file)
@@ -1477,6 +1477,7 @@ int __bt_bluez_request(int function_name,
 
                        conn_info.device_role = RFCOMM_ROLE_CLIENT;
                        conn_info.socket_fd = -1;
+                       memcpy(&conn_info.device_addr, &address, sizeof(bluetooth_device_address_t));
                        g_array_append_vals(*out_param1, &conn_info,
                                        sizeof(bluetooth_rfcomm_connection_t));
                } else {
@@ -4448,6 +4449,7 @@ normal:
                        conn_info.device_role = L2CAP_LE_ROLE_CLIENT;
                        conn_info.socket_fd = -1;
                        conn_info.psm = psm;
+                       memcpy(&conn_info.device_addr, &address, sizeof(bluetooth_device_address_t));
                        g_array_append_vals(*out_param1, &conn_info,
                                        sizeof(bluetooth_l2cap_le_connection_t));
                } else {