+ 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;
+ }