Loading system/bta/jv/bta_jv_act.cc +6 −20 Original line number Diff line number Diff line Loading @@ -1536,16 +1536,9 @@ void bta_jv_rfcomm_connect(tBTA_SEC sec_mask, uint8_t remote_scn, const RawAddre 0); } uint16_t mtu = BTA_JV_DEF_RFC_MTU; if (com::android::bluetooth::flags::socket_settings_api()) { if (cfg.rx_mtu_present) { mtu = cfg.rx_mtu; } } if (RFCOMM_CreateConnectionWithSecurity(UUID_SERVCLASS_SERIAL_PORT, remote_scn, false, mtu, peer_bd_addr, &handle, bta_jv_port_mgmt_cl_cback, sec_mask, cfg) != PORT_SUCCESS) { if (RFCOMM_CreateConnectionWithSecurity( UUID_SERVCLASS_SERIAL_PORT, remote_scn, false, BTA_JV_DEF_RFC_MTU, peer_bd_addr, &handle, bta_jv_port_mgmt_cl_cback, sec_mask, cfg) != PORT_SUCCESS) { log::error("RFCOMM_CreateConnection failed"); bta_jv.rfc_cl_init.status = tBTA_JV_STATUS::FAILURE; } else { Loading Loading @@ -1863,17 +1856,10 @@ void bta_jv_rfcomm_start_server(tBTA_SEC sec_mask, uint8_t local_scn, uint8_t ma memset(&evt_data, 0, sizeof(evt_data)); evt_data.status = tBTA_JV_STATUS::FAILURE; uint16_t mtu = BTA_JV_DEF_RFC_MTU; if (com::android::bluetooth::flags::socket_settings_api()) { if (cfg.rx_mtu_present) { mtu = cfg.rx_mtu; } } do { if (RFCOMM_CreateConnectionWithSecurity(0, local_scn, true, mtu, RawAddress::kAny, &handle, bta_jv_port_mgmt_sr_cback, sec_mask, cfg) != PORT_SUCCESS) { if (RFCOMM_CreateConnectionWithSecurity(0, local_scn, true, BTA_JV_DEF_RFC_MTU, RawAddress::kAny, &handle, bta_jv_port_mgmt_sr_cback, sec_mask, cfg) != PORT_SUCCESS) { log::error("RFCOMM_CreateConnection failed"); break; } Loading system/btif/src/btif_sock_rfc.cc +1 −7 Original line number Diff line number Diff line Loading @@ -683,8 +683,6 @@ static uint32_t on_srv_rfc_connect_offload(tBTA_JV_RFCOMM_SRV_OPEN* p_open, uint // Start monitoring the socket. btsock_thread_add_fd(pth, srv_rs->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_EXCEPTION, srv_rs->id); btsock_thread_add_fd(pth, accept_rs->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_RD, accept_rs->id); accept_rs->app_fd = INVALID_FD; // Ownership of the application fd has been transferred. // start monitoring the socketpair to get call back when app is accepting on server socket btsock_thread_add_fd(pth, srv_rs->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_RD, srv_rs->id); return srv_rs->id; Loading Loading @@ -847,12 +845,8 @@ void on_btsocket_rfc_opened_complete(uint64_t socket_id, bool success) { // The fd is closed after sent to app in send_app_connect_signal() slot->app_fd = -1; } else { if (!send_app_scn(slot)) { log::error("Unable to send rfcomm socket to application socket_id: {}", slot->id); return; } if (!send_app_connect_signal(slot->fd, &slot->addr, slot->scn, 0, -1, slot->socket_id)) { log::error("Unable to connect l2cap socket to application socket_id: {}", slot->id); log::error("Unable to connect rfcomm socket to application socket_id: {}", slot->id); return; } Loading system/stack/rfcomm/port_api.cc +10 −6 Original line number Diff line number Diff line Loading @@ -189,12 +189,6 @@ int RFCOMM_CreateConnectionWithSecurity(uint16_t uuid, uint8_t scn, bool is_serv p_port->scn = scn; p_port->ev_mask = 0; // Set the optional configuration for future use when the server or client negotiates the // parameters with the peer device. if (com::android::bluetooth::flags::socket_settings_api()) { p_port->rfc_cfg_info = cfg; } // Find MTU // If the MTU is not specified (0), keep MTU decision until the PN frame has // to be send at that time connection should be established and we will know Loading @@ -206,6 +200,16 @@ int RFCOMM_CreateConnectionWithSecurity(uint16_t uuid, uint8_t scn, bool is_serv p_port->mtu = rfcomm_mtu; } // Set the optional configuration for future use when the server or client negotiates the // parameters with the peer device. if (com::android::bluetooth::flags::socket_settings_api()) { p_port->rfc_cfg_info = cfg; // Update the local mtu with the optional configuration if set by the app if (p_port->rfc_cfg_info.rx_mtu_present) { p_port->mtu = p_port->rfc_cfg_info.rx_mtu; } } // Other states // server doesn't need to release port when closing if (is_server) { Loading system/stack/rfcomm/port_rfc.cc +0 −7 Original line number Diff line number Diff line Loading @@ -305,13 +305,6 @@ void PORT_ParNegInd(tRFC_MCB* p_mcb, uint8_t dlci, uint16_t mtu, uint8_t cl, uin p_port->bd_addr = p_mcb->bd_addr; /* Update the local mtu with the optional configuration if set by the app */ if (com::android::bluetooth::flags::socket_settings_api()) { if (p_port->rfc_cfg_info.rx_mtu_present) { p_port->mtu = p_port->rfc_cfg_info.rx_mtu; } } /* Connection is up and we know local and remote features, select MTU */ port_select_mtu(p_port); Loading Loading
system/bta/jv/bta_jv_act.cc +6 −20 Original line number Diff line number Diff line Loading @@ -1536,16 +1536,9 @@ void bta_jv_rfcomm_connect(tBTA_SEC sec_mask, uint8_t remote_scn, const RawAddre 0); } uint16_t mtu = BTA_JV_DEF_RFC_MTU; if (com::android::bluetooth::flags::socket_settings_api()) { if (cfg.rx_mtu_present) { mtu = cfg.rx_mtu; } } if (RFCOMM_CreateConnectionWithSecurity(UUID_SERVCLASS_SERIAL_PORT, remote_scn, false, mtu, peer_bd_addr, &handle, bta_jv_port_mgmt_cl_cback, sec_mask, cfg) != PORT_SUCCESS) { if (RFCOMM_CreateConnectionWithSecurity( UUID_SERVCLASS_SERIAL_PORT, remote_scn, false, BTA_JV_DEF_RFC_MTU, peer_bd_addr, &handle, bta_jv_port_mgmt_cl_cback, sec_mask, cfg) != PORT_SUCCESS) { log::error("RFCOMM_CreateConnection failed"); bta_jv.rfc_cl_init.status = tBTA_JV_STATUS::FAILURE; } else { Loading Loading @@ -1863,17 +1856,10 @@ void bta_jv_rfcomm_start_server(tBTA_SEC sec_mask, uint8_t local_scn, uint8_t ma memset(&evt_data, 0, sizeof(evt_data)); evt_data.status = tBTA_JV_STATUS::FAILURE; uint16_t mtu = BTA_JV_DEF_RFC_MTU; if (com::android::bluetooth::flags::socket_settings_api()) { if (cfg.rx_mtu_present) { mtu = cfg.rx_mtu; } } do { if (RFCOMM_CreateConnectionWithSecurity(0, local_scn, true, mtu, RawAddress::kAny, &handle, bta_jv_port_mgmt_sr_cback, sec_mask, cfg) != PORT_SUCCESS) { if (RFCOMM_CreateConnectionWithSecurity(0, local_scn, true, BTA_JV_DEF_RFC_MTU, RawAddress::kAny, &handle, bta_jv_port_mgmt_sr_cback, sec_mask, cfg) != PORT_SUCCESS) { log::error("RFCOMM_CreateConnection failed"); break; } Loading
system/btif/src/btif_sock_rfc.cc +1 −7 Original line number Diff line number Diff line Loading @@ -683,8 +683,6 @@ static uint32_t on_srv_rfc_connect_offload(tBTA_JV_RFCOMM_SRV_OPEN* p_open, uint // Start monitoring the socket. btsock_thread_add_fd(pth, srv_rs->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_EXCEPTION, srv_rs->id); btsock_thread_add_fd(pth, accept_rs->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_RD, accept_rs->id); accept_rs->app_fd = INVALID_FD; // Ownership of the application fd has been transferred. // start monitoring the socketpair to get call back when app is accepting on server socket btsock_thread_add_fd(pth, srv_rs->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_RD, srv_rs->id); return srv_rs->id; Loading Loading @@ -847,12 +845,8 @@ void on_btsocket_rfc_opened_complete(uint64_t socket_id, bool success) { // The fd is closed after sent to app in send_app_connect_signal() slot->app_fd = -1; } else { if (!send_app_scn(slot)) { log::error("Unable to send rfcomm socket to application socket_id: {}", slot->id); return; } if (!send_app_connect_signal(slot->fd, &slot->addr, slot->scn, 0, -1, slot->socket_id)) { log::error("Unable to connect l2cap socket to application socket_id: {}", slot->id); log::error("Unable to connect rfcomm socket to application socket_id: {}", slot->id); return; } Loading
system/stack/rfcomm/port_api.cc +10 −6 Original line number Diff line number Diff line Loading @@ -189,12 +189,6 @@ int RFCOMM_CreateConnectionWithSecurity(uint16_t uuid, uint8_t scn, bool is_serv p_port->scn = scn; p_port->ev_mask = 0; // Set the optional configuration for future use when the server or client negotiates the // parameters with the peer device. if (com::android::bluetooth::flags::socket_settings_api()) { p_port->rfc_cfg_info = cfg; } // Find MTU // If the MTU is not specified (0), keep MTU decision until the PN frame has // to be send at that time connection should be established and we will know Loading @@ -206,6 +200,16 @@ int RFCOMM_CreateConnectionWithSecurity(uint16_t uuid, uint8_t scn, bool is_serv p_port->mtu = rfcomm_mtu; } // Set the optional configuration for future use when the server or client negotiates the // parameters with the peer device. if (com::android::bluetooth::flags::socket_settings_api()) { p_port->rfc_cfg_info = cfg; // Update the local mtu with the optional configuration if set by the app if (p_port->rfc_cfg_info.rx_mtu_present) { p_port->mtu = p_port->rfc_cfg_info.rx_mtu; } } // Other states // server doesn't need to release port when closing if (is_server) { Loading
system/stack/rfcomm/port_rfc.cc +0 −7 Original line number Diff line number Diff line Loading @@ -305,13 +305,6 @@ void PORT_ParNegInd(tRFC_MCB* p_mcb, uint8_t dlci, uint16_t mtu, uint8_t cl, uin p_port->bd_addr = p_mcb->bd_addr; /* Update the local mtu with the optional configuration if set by the app */ if (com::android::bluetooth::flags::socket_settings_api()) { if (p_port->rfc_cfg_info.rx_mtu_present) { p_port->mtu = p_port->rfc_cfg_info.rx_mtu; } } /* Connection is up and we know local and remote features, select MTU */ port_select_mtu(p_port); Loading