+#ifndef GATT_NO_RELAY
+ case BT_GATT_WATCH_CHARACTERISTIC: {
+ char *sender = NULL;
+
+ sender = (char *)g_dbus_method_invocation_get_sender(context);
+
+ result = _bt_insert_gatt_client_sender(sender);
+
+ break;
+ }
+ case BT_GATT_UNWATCH_CHARACTERISTIC: {
+ char *sender = NULL;
+
+ sender = (char *)g_dbus_method_invocation_get_sender(context);
+
+ result = _bt_delete_gatt_client_sender(sender);
+
+ break;
+ }
+#endif
+ case BT_LE_IPSP_INIT:
+ result = _bt_initialize_ipsp();
+ break;
+ case BT_LE_IPSP_DEINIT:
+ result = _bt_deinitialize_ipsp();
+ break;
+ case BT_LE_IPSP_CONNECT: {
+ bluetooth_device_address_t address = { {0} };
+ __bt_service_get_parameters(in_param1, &address,
+ sizeof(bluetooth_device_address_t));
+
+ result = _bt_connect_le_ipsp_device(&address);
+ break;
+ }
+ case BT_LE_IPSP_DISCONNECT: {
+ bluetooth_device_address_t address = { {0} };
+
+ __bt_service_get_parameters(in_param1, &address,
+ sizeof(bluetooth_device_address_t));
+
+ result = _bt_disconnect_le_ipsp_device(&address);
+ break;
+ }
+ case BT_LE_READ_MAXIMUM_DATA_LENGTH: {
+ bluetooth_le_read_maximum_data_length_t max_le_datalength = {0};
+
+ result = _bt_le_read_maximum_data_length(&max_le_datalength);
+
+ g_array_append_vals(*out_param1, &max_le_datalength,
+ sizeof(bluetooth_le_read_maximum_data_length_t));
+ break;
+ }
+ case BT_LE_WRITE_HOST_SUGGESTED_DATA_LENGTH: {
+ unsigned int def_tx_Octects = 0;
+ unsigned int def_tx_Time = 0;
+
+ __bt_service_get_parameters(in_param1,
+ &def_tx_Octects, sizeof(int));
+ __bt_service_get_parameters(in_param2,
+ &def_tx_Time, sizeof(int));
+
+ result = _bt_le_write_host_suggested_default_data_length(
+ def_tx_Octects, def_tx_Time);
+ break;
+ }
+ case BT_LE_READ_HOST_SUGGESTED_DATA_LENGTH: {
+ bluetooth_le_read_host_suggested_data_length_t def_data_length = {0};
+
+ result = _bt_le_read_host_suggested_default_data_length(&def_data_length);
+
+ g_array_append_vals(*out_param1, &def_data_length,
+ sizeof(bluetooth_le_read_host_suggested_data_length_t));
+
+ break;
+ }
+ case BT_LE_SET_DATA_LENGTH: {
+ int max_tx_Octets = 0;
+ int max_tx_Time = 0;
+ bluetooth_device_address_t address = { {0} };
+
+ __bt_service_get_parameters(in_param1, &address,
+ sizeof(bluetooth_device_address_t));
+ __bt_service_get_parameters(in_param2,
+ &max_tx_Octets, sizeof(int));
+ __bt_service_get_parameters(in_param3,
+ &max_tx_Time, sizeof(int));
+
+ result = _bt_le_set_data_length(&address, max_tx_Octets, max_tx_Time);
+ break;
+ }
+ case BT_DPM_SET_ALLOW_BT_MODE: {
+ dpm_bt_allow_t value = DPM_BT_ERROR;
+
+ __bt_service_get_parameters(in_param1, &value,
+ sizeof(int));
+
+ result = _bt_dpm_set_allow_bluetooth_mode(value);
+ break;
+ }
+ case BT_DPM_GET_ALLOW_BT_MODE: {
+ dpm_bt_allow_t value = DPM_BT_ERROR;
+
+ value = _bt_dpm_get_allow_bluetooth_mode();
+ result = DPM_RESULT_SUCCESS;
+ g_array_append_vals(*out_param1, &value, sizeof(int));
+
+ break;
+ }
+ case BT_DPM_SET_DEVICE_RESTRITION: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ __bt_service_get_parameters(in_param1, &value,
+ sizeof(int));
+
+ result = _bt_dpm_activate_bluetooth_device_restriction(value);
+ break;
+ }
+ case BT_DPM_GET_DEVICE_RESTRITION: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ value = _bt_dpm_is_bluetooth_device_restriction_active();
+ result = DPM_RESULT_SUCCESS;
+ g_array_append_vals(*out_param1, &value, sizeof(int));
+
+ break;
+ }
+ case BT_DPM_SET_UUID_RESTRITION: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ __bt_service_get_parameters(in_param1, &value,
+ sizeof(int));
+
+ result = _bt_dpm_activate_bluetoooth_uuid_restriction(value);
+ break;
+ }
+ case BT_DPM_GET_UUID_RESTRITION: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ value = _bt_dpm_is_bluetooth_uuid_restriction_active();
+ result = DPM_RESULT_SUCCESS;
+ g_array_append_vals(*out_param1, &value, sizeof(int));
+
+ break;
+ }
+ case BT_DPM_ADD_DEVICES_BLACKLIST: {
+ bluetooth_device_address_t address = { {0} };
+
+ __bt_service_get_parameters(in_param1, &address,
+ sizeof(bluetooth_device_address_t));
+
+ result = _bt_dpm_add_bluetooth_devices_to_blacklist(&address);
+ break;
+ }
+ case BT_DPM_ADD_DEVICES_WHITELIST: {
+ bluetooth_device_address_t address = { {0} };
+
+ __bt_service_get_parameters(in_param1, &address,
+ sizeof(bluetooth_device_address_t));
+
+ result = _bt_dpm_add_bluetooth_devices_to_whitelist(&address);
+ break;
+ }
+ case BT_DPM_ADD_UUIDS_BLACKLIST: {
+ const char *uuid = NULL;
+
+ uuid = g_variant_get_data(in_param1);
+
+ result = _bt_dpm_add_bluetooth_uuids_to_blacklist(uuid);
+ break;
+ }
+ case BT_DPM_ADD_UUIDS_WHITELIST: {
+ const char *uuid = NULL;
+
+ uuid = g_variant_get_data(in_param1);
+
+ result = _bt_dpm_add_bluetooth_uuids_to_whitelist(uuid);
+ break;
+ }
+ case BT_DPM_CLEAR_DEVICES_BLACKLIST: {
+ result = _bt_dpm_clear_bluetooth_devices_from_blacklist();
+ break;
+ }
+ case BT_DPM_CLEAR_DEVICES_WHITELIST: {
+ result = _bt_dpm_clear_bluetooth_devices_from_whitelist();
+ break;
+ }
+ case BT_DPM_CLEAR_UUIDS_BLACKLIST: {
+ result = _bt_dpm_clear_bluetooth_uuids_from_blacklist();
+ break;
+ }
+ case BT_DPM_CLEAR_UUIDS_WHITELIST: {
+ result = _bt_dpm_clear_bluetooth_uuids_from_whitelist();
+ break;
+ }
+ case BT_DPM_REMOVE_DEVICE_BLACKLIST: {
+ bluetooth_device_address_t address = { {0} };
+
+ __bt_service_get_parameters(in_param1, &address,
+ sizeof(bluetooth_device_address_t));
+
+ result = _bt_dpm_remove_bluetooth_devices_from_blacklist(&address);
+ break;
+ }
+ case BT_DPM_REMOVE_DEVICE_WHITELIST: {
+ bluetooth_device_address_t address = { {0} };
+
+ __bt_service_get_parameters(in_param1, &address,
+ sizeof(bluetooth_device_address_t));
+
+ result = _bt_dpm_remove_bluetooth_devices_from_whitelist(&address);
+ break;
+ }
+ case BT_DPM_REMOVE_UUID_BLACKLIST: {
+ const char *uuid = NULL;
+
+ uuid = g_variant_get_data(in_param1);
+
+ result = _bt_dpm_remove_bluetooth_uuids_from_blacklist(uuid);
+ break;
+ }
+ case BT_DPM_REMOVE_UUID_WHITELIST: {
+ const char *uuid = NULL;
+
+ uuid = g_variant_get_data(in_param1);
+
+ result = _bt_dpm_remove_bluetooth_uuids_from_whitelist(uuid);
+
+ break;
+ }
+ case BT_DPM_GET_DEVICES_BLACKLIST: {
+ result = _bt_dpm_get_bluetooth_devices_from_blacklist(out_param1);
+ break;
+ }
+ case BT_DPM_GET_DEVICES_WHITELIST: {
+ result = _bt_dpm_get_bluetooth_devices_from_whitelist(out_param1);
+ break;
+ }
+ case BT_DPM_GET_UUIDS_BLACKLIST: {
+ result = _bt_dpm_get_bluetooth_uuids_from_blacklist(out_param1);
+ break;
+ }
+ case BT_DPM_GET_UUIDS_WHITELIST: {
+ result = _bt_dpm_get_bluetooth_uuids_from_whitelist(out_param1);
+ break;
+ }
+ case BT_DPM_SET_ALLOW_OUTGOING_CALL: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ __bt_service_get_parameters(in_param1, &value,
+ sizeof(int));
+
+ result = _bt_dpm_set_allow_bluetooth_outgoing_call(value);
+
+ break;
+ }
+ case BT_DPM_GET_ALLOW_OUTGOING_CALL: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ value = _bt_dpm_get_allow_bluetooth_outgoing_call();
+ result = DPM_RESULT_SUCCESS;
+ g_array_append_vals(*out_param1, &value, sizeof(int));
+
+ break;
+ }
+ case BT_DPM_SET_PAIRING_STATE: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ __bt_service_get_parameters(in_param1, &value,
+ sizeof(int));
+
+ result = _bt_dpm_set_bluetooth_pairing_state(value);
+
+ break;
+ }
+ case BT_DPM_GET_PAIRING_STATE: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ value = _bt_dpm_get_bluetooth_pairing_state();
+ result = DPM_RESULT_SUCCESS;
+ g_array_append_vals(*out_param1, &value, sizeof(int));
+
+ break;
+ }
+ case BT_DPM_SET_PROFILE_STATE: {
+ dpm_status_t value = DPM_BT_ERROR;
+ dpm_profile_t profile = DPM_PROFILE_NONE;
+
+ __bt_service_get_parameters(in_param1, &profile,
+ sizeof(int));
+ __bt_service_get_parameters(in_param2, &value,
+ sizeof(int));
+
+ result = _bt_dpm_set_bluetooth_profile_state(profile, value);
+
+ break;
+ }
+ case BT_DPM_GET_PROFILE_STATE: {
+ dpm_status_t value = DPM_BT_ERROR;
+ dpm_profile_t profile = DPM_PROFILE_NONE;
+
+ __bt_service_get_parameters(in_param2, &profile,
+ sizeof(int));
+
+ value = _bt_dpm_get_bluetooth_profile_state(profile);
+ result = DPM_RESULT_SUCCESS;
+ g_array_append_vals(*out_param1, &value, sizeof(int));
+
+ break;
+ }
+ case BT_DPM_SET_DESKROP_CONNECTIVITY_STATE: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ __bt_service_get_parameters(in_param1, &value,
+ sizeof(int));
+
+ result = _bt_dpm_set_bluetooth_desktop_connectivity_state(value);
+
+ break;
+ }
+ case BT_DPM_GET_DESKROP_CONNECTIVITY_STATE: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ value = _bt_dpm_get_bluetooth_desktop_connectivity_state();
+ result = DPM_RESULT_SUCCESS;
+ g_array_append_vals(*out_param1, &value, sizeof(int));
+
+ break;
+ }
+ case BT_DPM_SET_DISCOVERABLE_STATE: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ __bt_service_get_parameters(in_param1, &value,
+ sizeof(int));
+
+ result = _bt_dpm_set_bluetooth_discoverable_state(value);
+
+ break;
+ }
+ case BT_DPM_GET_DISCOVERABLE_STATE: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ value = _bt_dpm_get_bluetooth_discoverable_state();
+ result = DPM_RESULT_SUCCESS;
+ g_array_append_vals(*out_param1, &value, sizeof(int));
+
+ break;
+ }
+ case BT_DPM_SET_LIMITED_DISCOVERABLE_STATE: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ __bt_service_get_parameters(in_param1, &value,
+ sizeof(int));
+
+ result = _bt_dpm_set_bluetooth_limited_discoverable_state(value);
+
+ break;
+ }
+ case BT_DPM_GET_LIMITED_DISCOVERABLE_STATE: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ value = _bt_dpm_get_bluetooth_limited_discoverable_state();
+ result = DPM_RESULT_SUCCESS;
+ g_array_append_vals(*out_param1, &value, sizeof(int));
+
+ break;
+ }
+ case BT_DPM_SET_DATA_TRANSFER_STATE: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ __bt_service_get_parameters(in_param1, &value,
+ sizeof(int));
+
+ result = _bt_dpm_set_bluetooth_data_transfer_state(value);
+
+ break;
+ }
+ case BT_DPM_GET_DATA_TRANSFER_STATE: {
+ dpm_status_t value = DPM_BT_ERROR;
+
+ value = _bt_dpm_get_allow_bluetooth_data_transfer_state();
+ result = DPM_RESULT_SUCCESS;
+ g_array_append_vals(*out_param1, &value, sizeof(int));
+
+ break;
+ }
+ case BT_PXP_SET_PROPERTY: {
+ bluetooth_device_address_t address = { {0} };
+ unsigned int property = 0;
+ unsigned int value = 0;
+
+ __bt_service_get_parameters(in_param1,
+ &address, sizeof(bluetooth_device_address_t));
+ __bt_service_get_parameters(in_param2,
+ &property, sizeof(int));
+ __bt_service_get_parameters(in_param3,
+ &value, sizeof(int));
+
+ result = bt_set_proximity_property(&address, property, value);
+ break;
+ }
+ case BT_PXP_GET_PROPERTY: {
+ bluetooth_device_address_t address = { {0} };
+ unsigned int property = 0;
+ int value = 0;
+
+ __bt_service_get_parameters(in_param1,
+ &address, sizeof(bluetooth_device_address_t));
+ __bt_service_get_parameters(in_param2,
+ &property, sizeof(unsigned int));
+
+ result = bt_get_proximity_property(&address, property, &value);
+ if (result == BLUETOOTH_ERROR_NONE) {
+ g_array_append_vals(*out_param1, &value,
+ sizeof(int));
+ }
+ break;
+ }
+ case BT_PXP_GET_SUPPORTED_SERIVCES: {
+ bluetooth_device_address_t address = { {0} };
+ unsigned int property = 0;
+
+ __bt_service_get_parameters(in_param1,
+ &address, sizeof(bluetooth_device_address_t));
+
+ result = bt_get_proximity_supported_services(&address, &property);
+ if (result == BLUETOOTH_ERROR_NONE) {
+ g_array_append_vals(*out_param1, &property,
+ sizeof(int));
+ }
+ break;
+ }
+ case BT_PXP_REGISTER_REPORTER: {
+ result = bt_register_proximity_reporter();
+ break;
+ }
+ case BT_PXP_UNREGISTER_REPORTER: {
+ result = bt_unregister_proximity_reporter();
+ break;
+ }