Skip to content
Snippets Groups Projects
Commit 736061d8 authored by Chris Manton's avatar Chris Manton
Browse files

shim: Plumb e/sco connect request

Bug: 183476377
Test: gd/cert/run
Tag: #refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: If14d3bf2f8c632e9007fa846d514a9c3e7bbe18a
parent e1cacecb
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,8 @@ const acl_interface_t GetAclInterface() {
.connection.le.on_failed = acl_ble_connection_fail,
.connection.le.on_disconnected = btm_acl_disconnected,
.connection.sco.on_esco_connect_request = btm_sco_on_esco_connect_request,
.connection.sco.on_sco_connect_request = btm_sco_on_sco_connect_request,
.connection.sco.on_disconnected = btm_sco_on_disconnected,
.link.classic.on_authentication_complete = btm_sec_auth_complete,
......
......@@ -21,6 +21,7 @@
#include "stack/include/hci_error_code.h"
#include "stack/include/hcidefs.h"
#include "types/ble_address_with_type.h"
#include "types/class_of_device.h"
#include "types/hci_role.h"
#include "types/raw_address.h"
......@@ -49,6 +50,8 @@ typedef struct {
} acl_le_connection_interface_t;
typedef struct {
void (*on_esco_connect_request)(const RawAddress, const types::ClassOfDevice);
void (*on_sco_connect_request)(const RawAddress, const types::ClassOfDevice);
void (*on_disconnected)(uint16_t handle, tHCI_REASON reason);
} acl_sco_connection_interface_t;
......
......@@ -28,6 +28,7 @@ extern std::map<std::string, int> mock_function_count_map;
#include "stack/include/btm_api_types.h"
#include "stack/include/btm_status.h"
#include "stack/include/hci_error_code.h"
#include "types/class_of_device.h"
#include "types/raw_address.h"
#ifndef UNUSED_ATTR
......@@ -111,6 +112,14 @@ void btm_sco_connected(tHCI_STATUS hci_status, const RawAddress& bda,
void btm_sco_disc_chk_pend_for_modechange(uint16_t hci_handle) {
mock_function_count_map[__func__]++;
}
void btm_sco_on_esco_connect_request(
const RawAddress bda, const bluetooth::types::ClassOfDevice cod) {
mock_function_count_map[__func__]++;
}
void btm_sco_on_sco_connect_request(const RawAddress bda,
const bluetooth::types::ClassOfDevice cod) {
mock_function_count_map[__func__]++;
}
void btm_sco_on_disconnected(uint16_t hci_handle, tHCI_REASON reason) {
mock_function_count_map[__func__]++;
}
......@@ -38,6 +38,8 @@
#include "stack/include/btm_api_types.h"
#include "stack/include/hci_error_code.h"
#include "stack/include/hcimsgs.h"
#include "types/class_of_device.h"
#include "types/raw_address.h"
extern tBTM_CB btm_cb;
......@@ -874,6 +876,18 @@ bool btm_sco_removed(uint16_t hci_handle, tHCI_REASON reason) {
return false;
}
void btm_sco_on_esco_connect_request(
const RawAddress bda, const bluetooth::types::ClassOfDevice cod) {
LOG_ERROR("Remote ESCO connect request unimplemented remote:%s",
PRIVATE_ADDRESS(bda));
}
void btm_sco_on_sco_connect_request(const RawAddress bda,
const bluetooth::types::ClassOfDevice cod) {
LOG_ERROR("Remote SCO connect request unimplemented remote:%s",
PRIVATE_ADDRESS(bda));
}
void btm_sco_on_disconnected(uint16_t hci_handle, tHCI_REASON reason) {
tSCO_CONN* p_sco = btm_cb.sco_cb.get_sco_connection_from_handle(hci_handle);
if (p_sco == nullptr) {
......
......@@ -20,6 +20,7 @@
#include <cstdint>
#include "stack/include/hci_error_code.h"
#include "types/class_of_device.h"
#include "types/raw_address.h"
struct tBTM_ESCO_DATA;
......@@ -37,3 +38,7 @@ extern void btm_sco_connected(tHCI_STATUS hci_status, const RawAddress& bda,
extern bool btm_sco_removed(uint16_t hci_handle, tHCI_REASON reason);
void btm_sco_on_disconnected(uint16_t hci_handle, tHCI_REASON reason);
void btm_sco_on_esco_connect_request(const RawAddress,
const bluetooth::types::ClassOfDevice);
void btm_sco_on_sco_connect_request(const RawAddress,
const bluetooth::types::ClassOfDevice);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment