#include "btif_util.h"
#include "btif_util.h"
#include "btu.h"
+#include "device/include/controller.h"
#include "device/include/interop.h"
#include "include/stack_config.h"
#include "osi/include/allocator.h"
local_le_features.debug_logging_supported =
cmn_vsc_cb.debug_logging_supported > 0;
+ const controller_t* controller = controller_get_interface();
+
+ local_le_features.le_2m_phy_supported = controller->supports_ble_2m_phy();
+ local_le_features.le_coded_phy_supported =
+ controller->supports_ble_coded_phy();
+ local_le_features.le_extended_advertising_supported =
+ controller->supports_ble_extended_advertising();
+ local_le_features.le_periodic_advertising_supported =
+ controller->supports_ble_periodic_advertising();
+
memcpy(prop.val, &local_le_features, prop.len);
HAL_CBACK(bt_hal_cbacks, adapter_properties_cb, BT_STATUS_SUCCESS, 1,
&prop);
bool (*supports_ble_packet_extension)(void);
bool (*supports_ble_connection_parameters_request)(void);
bool (*supports_ble_privacy)(void);
+ bool (*supports_ble_2m_phy)(void);
+ bool (*supports_ble_coded_phy)(void);
bool (*supports_ble_extended_advertising)(void);
bool (*supports_ble_periodic_advertising)(void);
return HCI_LE_CONN_PARAM_REQ_SUPPORTED(features_ble.as_array);
}
+static bool supports_ble_2m_phy(void) {
+ CHECK(readable);
+ CHECK(ble_supported);
+ return HCI_LE_2M_PHY_SUPPORTED(features_ble.as_array);
+}
+
+static bool supports_ble_coded_phy(void) {
+ CHECK(readable);
+ CHECK(ble_supported);
+ return HCI_LE_CODED_PHY_SUPPORTED(features_ble.as_array);
+}
+
static bool supports_ble_extended_advertising(void) {
CHECK(readable);
CHECK(ble_supported);
supports_ble_packet_extension,
supports_ble_connection_parameters_request,
supports_ble_privacy,
+ supports_ble_2m_phy,
+ supports_ble_coded_phy,
supports_ble_extended_advertising,
supports_ble_periodic_advertising,
((x)[HCI_SUPP_COMMANDS_LE_RC_CONN_PARAM_UPD_NEG_RPY_OFF] & \
HCI_SUPP_COMMANDS_RLE_RC_CONN_PARAM_UPD_NEG_RPY_MASK)
+#define HCI_LE_2M_PHY_SUPPORTED(x) (((x)[1] & 0x01)) // BIT 8 SET
+#define HCI_LE_CODED_PHY_SUPPORTED(x) (((x)[1] & 0x08)) // BIT 11 SET
+
/* LE Advertising Extension related Procedurs */
#define HCI_LE_EXTENDED_ADVERTISING_SUPPORTED(x) \
(((x)[1] & 0x10)) // BIT 12 SET