|| service_function == BT_MESH_NETWORK_DELETE_APPKEY
|| service_function == BT_MESH_NETWORK_UPDATE_APPKEY
|| service_function == BT_L2CAP_LE_LISTEN_AND_ACCEPT
- || service_function == BT_L2CAP_LE_LISTEN)
+ || service_function == BT_L2CAP_LE_LISTEN
+ || service_function == BT_REQ_ATT_MTU)
return TRUE;
else
return FALSE;
int *adv_handle;
bluetooth_advertising_data_t adv = { {0} };
int length;
- gboolean use_reserved_slot = FALSE;
+ bluetooth_le_slot_and_adv_type_t rs_at;
+ rs_at.is_legacy = TRUE;
+ rs_at.use_reserved_slot = FALSE;
app = (char *)g_dbus_method_invocation_get_sender(context);
adv_handle = g_malloc0(sizeof(int));
__bt_service_get_parameters(in_param2,
&adv, length);
__bt_service_get_parameters(in_param4,
- &use_reserved_slot, sizeof(gboolean));
+ &rs_at, sizeof(bluetooth_le_slot_and_adv_type_t));
result = _bt_set_advertising_data(app, *adv_handle,
- &adv, length, use_reserved_slot);
+ &adv, length, &rs_at);
if (result != BLUETOOTH_ERROR_NONE) {
BT_ERR("Set Advertising data failed!!");
g_free(adv_handle);
result = _bt_gatt_server_update_attribute_value(app, instance_id, ¶m);
break;
}
+ case BT_GATT_SERVER_READ_PHY: {
+ bluetooth_device_address_t address = { {0} };
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1,
+ &address, sizeof(bluetooth_device_address_t));
+
+ result = _bt_gatt_server_read_phy(&address);
+ break;
+ }
+ case BT_GATT_SERVER_SET_PHY: {
+ bluetooth_device_address_t address = { {0} };
+ int tx_phy;
+ int rx_phy;
+ int phy_options;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1,
+ &address, sizeof(bluetooth_device_address_t));
+ __bt_service_get_parameters(in_param2,
+ &tx_phy, sizeof(int));
+ __bt_service_get_parameters(in_param3,
+ &rx_phy, sizeof(int));
+ __bt_service_get_parameters(in_param4,
+ &phy_options, sizeof(int));
+
+ result = _bt_gatt_server_set_phy(&address, tx_phy, rx_phy, phy_options);
+ break;
+ }
+ case BT_GATT_CLIENT_READ_PHY: {
+ bluetooth_device_address_t address = { {0} };
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1,
+ &address, sizeof(bluetooth_device_address_t));
+
+ result = _bt_gatt_client_read_phy(&address);
+ break;
+ }
+ case BT_GATT_CLIENT_SET_PHY: {
+ bluetooth_device_address_t address = { {0} };
+ int tx_phy;
+ int rx_phy;
+ int phy_options;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1,
+ &address, sizeof(bluetooth_device_address_t));
+ __bt_service_get_parameters(in_param2,
+ &tx_phy, sizeof(int));
+ __bt_service_get_parameters(in_param3,
+ &rx_phy, sizeof(int));
+ __bt_service_get_parameters(in_param4,
+ &phy_options, sizeof(int));
+
+ result = _bt_gatt_client_set_phy(&address, tx_phy, rx_phy, phy_options);
+ break;
+ }
case BT_GET_ATT_MTU: {
bluetooth_device_address_t address = { {0} };
unsigned int mtu = 0;
g_array_append_vals(*out_param1, &is_coded_phy_supported, sizeof(gboolean));
break;
}
+ case BT_IS_LE_EXTENDED_ADVERTISING_SUPPORTED: {
+ gboolean is_extended_advertising_supported = FALSE;
+
+ is_extended_advertising_supported = _bt_is_le_extended_advertising_supported();
+ g_array_append_vals(*out_param1, &is_extended_advertising_supported,
+ sizeof(gboolean));
+ break;
+ }
+ case BT_IS_LE_EXTENDED_SCAN_SUPPORTED: {
+ gboolean is_extended_scan_supported = FALSE;
+
+ is_extended_scan_supported = _bt_is_le_extended_scan_supported();
+ g_array_append_vals(*out_param1, &is_extended_scan_supported, sizeof(gboolean));
+ break;
+ }
+ case BT_LE_MAX_ADVERTISING_DATA_LEN: {
+ gint max_advertising_len = 0;
+
+ max_advertising_len = _bt_le_get_maximum_advertising_len();
+ g_array_append_vals(*out_param1, &max_advertising_len, sizeof(gint));
+ break;
+ }
case BT_DISCONNECT_DEVICE: {
bluetooth_device_address_t address = { {0} };
result = _bt_disconnect_device(&address);
break;
}
+ case BT_SET_SCANNING_PHY: {
+ int phy = 0;
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+ __bt_service_get_parameters(in_param1, &phy, sizeof(int));
+
+ result = _bt_set_scan_phy(sender, phy);
+
+ break;
+ }
+ case BT_SET_SCANNING_ROLE: {
+ int role = 0;
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+ __bt_service_get_parameters(in_param1, &role, sizeof(int));
+
+ result = _bt_set_scan_role(sender, role);
+
+ break;
+ }
case BT_REGISTER_SCAN_FILTER: {
bluetooth_le_scan_filter_t scan_filter;
return FALSE;
}
- BT_DBG("%s, %s, %s", unique_name, client_creds, user_creds);
+ BT_INFO("%s, %s, %s", unique_name, client_creds, user_creds);
switch (function_name) {
case BT_SET_LOCAL_NAME:
case BT_GATT_SERVER_UPDATE_VALUE:
case BT_GATT_SERVER_DEREGISTER:
#endif
+ case BT_GATT_SERVER_READ_PHY:
+ case BT_GATT_SERVER_SET_PHY:
+ case BT_GATT_CLIENT_READ_PHY:
+ case BT_GATT_CLIENT_SET_PHY:
case BT_REQ_ATT_MTU:
case BT_PBAP_CONNECT:
case BT_PBAP_DISCONNECT:
case BT_IS_ADVERTISING:
case BT_IS_LE_2M_PHY_SUPPORTED:
case BT_IS_LE_CODED_PHY_SUPPORTED:
+ case BT_SET_SCANNING_ROLE:
+ case BT_SET_SCANNING_PHY:
+ case BT_IS_LE_EXTENDED_ADVERTISING_SUPPORTED:
+ case BT_IS_LE_EXTENDED_SCAN_SUPPORTED:
+ case BT_LE_MAX_ADVERTISING_DATA_LEN:
case BT_REGISTER_SCAN_FILTER:
case BT_IS_SCAN_FILTER_SUPPORTED:
case BT_GET_ATT_MTU: