return result;
}
+
+BT_EXPORT_API int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
+{
+ int result;
+
+ BT_CHECK_PARAMETER(is_supported, return);
+ BT_CHECK_ENABLED_ANY(return);
+
+ BT_INIT_PARAMS();
+ BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+ result = _bt_send_request(BT_BLUEZ_SERVICE, BT_IS_LE_2M_PHY_SUPPORTED,
+ in_param1, in_param2, in_param3, in_param4, &out_param);
+
+ if (result == BLUETOOTH_ERROR_NONE) {
+ *is_supported = g_array_index(out_param, int, 0);
+ } else {
+ BT_ERR("Fail to send request");
+ }
+
+ BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+ BT_INFO("LE 2M PHY Support[%s]", *is_supported ? "TRUE" : "FALSE");
+ return result;
+}
+
+BT_EXPORT_API int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
+{
+ int result;
+
+ BT_CHECK_PARAMETER(is_supported, return);
+ BT_CHECK_ENABLED_ANY(return);
+
+ BT_INIT_PARAMS();
+ BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+ result = _bt_send_request(BT_BLUEZ_SERVICE, BT_IS_LE_CODED_PHY_SUPPORTED,
+ in_param1, in_param2, in_param3, in_param4, &out_param);
+
+ if (result == BLUETOOTH_ERROR_NONE) {
+ *is_supported = g_array_index(out_param, int, 0);
+ } else {
+ BT_ERR("Fail to send request");
+ }
+
+ BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+ BT_INFO("LE CODED PHY Support[%s]", *is_supported ? "TRUE" : "FALSE");
+ return result;
+}
return FALSE;
}
+gboolean _bt_is_le_2m_phy_supported(void)
+{
+ if (le_feature_info.le_2m_phy)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+gboolean _bt_is_le_coded_phy_supported(void)
+{
+ if (le_feature_info.le_coded_phy)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+
/*************************************** LE Scan APIs *********************************************/
sizeof(gboolean));
break;
}
+ case BT_IS_LE_2M_PHY_SUPPORTED: {
+ gboolean is_2m_phy_supported = FALSE;
+
+ is_2m_phy_supported = _bt_is_le_2m_phy_supported();
+ g_array_append_vals(*out_param1, &is_2m_phy_supported, sizeof(gboolean));
+ break;
+ }
+ case BT_IS_LE_CODED_PHY_SUPPORTED: {
+ gboolean is_coded_phy_supported = FALSE;
+
+ is_coded_phy_supported = _bt_is_le_coded_phy_supported();
+ g_array_append_vals(*out_param1, &is_coded_phy_supported, sizeof(gboolean));
+ break;
+ }
default:
BT_INFO("UnSupported function [%d]", function_name);
result = BLUETOOTH_ERROR_NOT_SUPPORT;
case BT_GET_ADVERTISING_DATA:
case BT_GET_SCAN_RESPONSE_DATA:
case BT_IS_ADVERTISING:
+ case BT_IS_LE_2M_PHY_SUPPORTED:
+ case BT_IS_LE_CODED_PHY_SUPPORTED:
case BT_REGISTER_SCAN_FILTER:
case BT_UNREGISTER_SCAN_FILTER:
case BT_UNREGISTER_ALL_SCAN_FILTERS:
void _bt_service_le_deinit(void);
+gboolean _bt_is_le_2m_phy_supported(void);
+
+gboolean _bt_is_le_coded_phy_supported(void);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
/**
+ * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
+ * @brief Check if Adapter supports LE 2M PHY feature or not.
+ *
+ * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
+ * in BT 5.0 specification.
+ *
+ * This function is a synchronous call.
+ *
+ * @return BLUETOOTH_ERROR_NONE - Succeess \n
+ * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
+ * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
+ * BLUETOOTH_ERROR_INTERNAL - Internal error \n
+ * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
+ *
+ * @remark None
+ */
+int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
+
+/**
+ * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
+ * @brief Check if Adapter supports LE 2M CODED feature or not.
+ *
+ * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
+ * in BT 5.0 specification.
+ *
+ * This function is a synchronous call.
+ *
+ * @return BLUETOOTH_ERROR_NONE - Succeess \n
+ * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
+ * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
+ * BLUETOOTH_ERROR_INTERNAL - Internal error \n
+ * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
+ *
+ * @remark None
+ */
+int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
+
+/**
* @}
*/
BT_GET_SCAN_RESPONSE_DATA,
BT_SET_SCAN_RESPONSE_DATA,
BT_IS_ADVERTISING,
+ BT_IS_LE_2M_PHY_SUPPORTED,
+ BT_IS_LE_CODED_PHY_SUPPORTED,
BT_SET_MANUFACTURER_DATA,
BT_LE_CONN_UPDATE,
BT_LE_READ_MAXIMUM_DATA_LENGTH,