#endif
#endif
bool is_default; /* true if adapter is default one */
+
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ bool le_2m_phy_supported;
+ bool le_coded_phy_supported;
+#endif
};
typedef enum {
const char *str, *val;
int value;
DBusMessageIter entry;
+ struct btd_adapter *adapter = user_data;
dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
- DBUS_TYPE_STRING_AS_STRING, &entry);
+ DBUS_TYPE_STRING_AS_STRING, &entry);
value = adapter_le_get_max_adv_instance();
if (value > 0) {
g_free((void *)val);
}
+ if (adapter->supported_settings & MGMT_SETTING_PHY_CONFIGURATION) {
+ /* 2M PHY Support */
+ str = g_strdup("2m_phy");
+ dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &str);
+
+ if (adapter->le_2m_phy_supported)
+ val = g_strdup("true");
+ else
+ val = g_strdup("false");
+
+ dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &val);
+
+ g_free((void *)str);
+ g_free((void *)val);
+
+ /* CODED PHY Support */
+ str = g_strdup("coded_phy");
+ dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &str);
+
+ if (adapter->le_coded_phy_supported)
+ val = g_strdup("true");
+ else
+ val = g_strdup("false");
+
+ dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &val);
+
+ g_free((void *)str);
+ g_free((void *)val);
+ }
+
dbus_message_iter_close_container(iter, &entry);
return TRUE;
adapter->connect_list = g_slist_remove(adapter->connect_list, device);
}
+#if defined (TIZEN_FEATURE_BLUEZ_MODIFY)
+static void get_phy_configuration_resp(uint8_t status, uint16_t len, const void *param,
+ void *user_data)
+{
+ uint32_t supported_phys;
+ uint32_t configurable_phys;
+ uint32_t selected_phys;
+
+ const struct mgmt_rp_get_phy_confguration *rp = param;
+ struct btd_adapter *adapter = user_data;
+
+ if (status != MGMT_STATUS_SUCCESS) {
+ error("Get PHY Configuration failed with status 0x%02x (%s)",
+ status, mgmt_errstr(status));
+ return;
+ }
+
+ if (len < sizeof(*rp)) {
+ error("Too small get-phy reply (%u bytes)", len);
+ return;
+ }
+
+ supported_phys = get_le32(&rp->supported_phys);
+ configurable_phys = get_le32(&rp-> configurable_phys);
+ selected_phys = get_le16(&rp->selected_phys);
+
+ DBG("Supported phys: [0x%x]", supported_phys);
+ DBG("Configurable phys: [0x%x]", configurable_phys);
+ DBG("Selected phys: [0x%x]", selected_phys);
+
+ if (adapter->supported_settings & MGMT_SETTING_LE) {
+ if ((supported_phys & MGMT_PHY_LE_2M_TX) &&
+ (supported_phys & MGMT_PHY_LE_2M_RX)) {
+ DBG("Adapter supports LE 2M PHY");
+ adapter->le_2m_phy_supported = TRUE;
+ } else
+ DBG("Adapter does not support LE 2M PHY");
+
+ if ((supported_phys & MGMT_PHY_LE_CODED_TX) &&
+ (supported_phys & MGMT_PHY_LE_CODED_RX)) {
+ adapter->le_coded_phy_supported = TRUE;
+ DBG("Adapter supports LE CODED PHY");
+ } else
+ DBG("Adapter does not support LE CODED PHY");
+ }
+
+ /* Emit Property Changed Signal */
+ g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ ADAPTER_INTERFACE, "SupportedLEFeatures");
+
+}
+#endif
+
static void adapter_start(struct btd_adapter *adapter)
{
+
#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && !defined(__SPRD_PATCH__)
if (adapter_le_read_ble_feature_info())
g_dbus_emit_property_changed(dbus_conn, adapter->path,
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
adapter_check_version(adapter, rp->version);
#endif
-
clear_uuids(adapter);
clear_devices(adapter);
missing_settings = adapter->current_settings ^
adapter->supported_settings;
+/* If adapter supports PHY CONFIGURATION SETTING, then read PHY configuration and save them */
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ if (adapter->supported_settings & MGMT_SETTING_PHY_CONFIGURATION) {
+ if (mgmt_send(adapter->mgmt, MGMT_OP_GET_PHY_CONFIGURATION, adapter->dev_id, 0, NULL,
+ get_phy_configuration_resp, adapter, NULL) == 0)
+ error("Unable to send %s cmd",
+ mgmt_opstr(MGMT_OP_GET_PHY_CONFIGURATION));
+ }
+#endif
switch (main_opts.mode) {
case BT_MODE_DUAL:
if (missing_settings & MGMT_SETTING_SSP) {