2 * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifdef TIZEN_FEATURE_BT_DPM
19 #ifndef _BT_SERVICE_DPM_H_
20 #define _BT_SERVICE_DPM_H_
23 #include <sys/types.h>
24 #include "bluetooth-api.h"
32 * @brief DPM BT allowance state
36 DPM_BT_ERROR = -1, /**< bluetooth allowance error */
37 DPM_BT_ALLOWED, /**< bluetooth allowance allowed */
38 DPM_BT_HANDSFREE_ONLY, /**< bluetooth allowance handsfree only */
39 DPM_BT_RESTRICTED, /**< bluetooth allowance restricted */
43 * @brief DPM API result
46 typedef enum _dpm_result {
47 DPM_RESULT_SERVICE_NOT_ENABLED = -5, /**< DPM API result service not enabled. */
48 DPM_RESULT_ACCESS_DENIED = -4, /**< DPM API result access denied. */
49 DPM_RESULT_INVALID_PARAM = -3, /**< DPM API result invalid parameter. */
50 DPM_RESULT_NOT_SUPPORTED = -2, /**< DPM API result not supported. */
51 DPM_RESULT_FAIL = -1, /**< DPM API result fail. */
52 DPM_RESULT_SUCCESS = 0, /**< DPM API result success. */
56 * @brief DPM Policy status
59 typedef enum _dpm_status {
60 DPM_STATUS_ERROR = -1,
62 DPM_ALLOWED = 0, /**< DPM Policy status allowed. */
63 DPM_RESTRICTED = 1, /**< DPM Policy status restricted. */
65 DPM_ENABLE = 1, /**< DPM Policy status enabled. */
66 DPM_DISABLE = 0, /**< DPM Policy status disabled. */
68 DPM_FALSE = 0, /**< DPM Policy status false. */
69 DPM_TRUE = 1, /**< DPM Policy status true. */
72 typedef enum _dpm_policy_cmd {
73 /* policy-group : BLUETOOTH */
74 DPM_POLICY_ALLOW_BLUETOOTH,
75 DPM_POLICY_BLUETOOTH_DEVICE_RESTRICTION,
76 DPM_POLICY_BLUETOOTH_UUID_RESTRICTION,
77 DPM_POLICY_BLUETOOTH_DEVICES_WHITELIST,
78 DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST,
79 DPM_POLICY_BLUETOOTH_UUIDS_WHITELIST,
80 DPM_POLICY_BLUETOOTH_UUIDS_BLACKLIST,
81 DPM_POLICY_ALLOW_BLUETOOTH_OUTGOING_CALL,
82 DPM_POLICY_BLUETOOTH_PAIRING_STATE,
83 DPM_POLICY_BLUETOOTH_DESKTOP_CONNECTIVITY_STATE,
84 DPM_POLICY_BLUETOOTH_DISCOVERABLE_STATE,
85 DPM_POLICY_BLUETOOTH_LIMITED_DISCOVERABLE_STATE,
86 DPM_POLICY_BLUETOOTH_DATA_TRANSFER_STATE,
97 typedef struct dpm_policy dpm_policy_t;
100 typedef enum dpm_profile {
101 DPM_POLICY_BLUETOOTH_A2DP_PROFILE_STATE,
102 DPM_POLICY_BLUETOOTH_AVRCP_PROFILE_STATE,
103 DPM_POLICY_BLUETOOTH_BPP_PROFILE_STATE,
104 DPM_POLICY_BLUETOOTH_DUN_PROFILE_STATE,
105 DPM_POLICY_BLUETOOTH_FTP_PROFILE_STATE,
106 DPM_POLICY_BLUETOOTH_HFP_PROFILE_STATE,
107 DPM_POLICY_BLUETOOTH_HSP_PROFILE_STATE,
108 DPM_POLICY_BLUETOOTH_PBAP_PROFILE_STATE,
109 DPM_POLICY_BLUETOOTH_SAP_PROFILE_STATE,
110 DPM_POLICY_BLUETOOTH_SPP_PROFILE_STATE,
114 struct dpm_profile_val {
115 int value; /* tells whether the profile is enabled or disabled */
117 typedef struct dpm_profile_val dpm_profile_state_t;
119 int _bt_dpm_set_allow_bluetooth_mode(dpm_bt_allow_t value);
120 int _bt_dpm_get_allow_bluetooth_mode(int *value);
121 int _bt_dpm_activate_bluetooth_device_restriction(dpm_status_t value);
122 int _bt_dpm_is_bluetooth_device_restriction_active(int *value);
123 int _bt_dpm_activate_bluetoooth_uuid_restriction(dpm_status_t value);
124 int _bt_dpm_is_bluetooth_uuid_restriction_active(int *value);
125 int _bt_dpm_add_bluetooth_devices_to_blacklist(bluetooth_device_address_t *bd_addr);
126 int _bt_dpm_add_bluetooth_devices_to_whitelist(bluetooth_device_address_t *bd_addr);
127 int _bt_dpm_add_bluetooth_uuids_to_blacklist(const char *uuid);
128 int _bt_dpm_add_bluetooth_uuids_to_whitelist(const char *uuid);
129 int _bt_dpm_set_allow_bluetooth_outgoing_call(dpm_status_t value);
130 int _bt_dpm_get_allow_bluetooth_outgoing_call(int *value);
131 int _bt_dpm_clear_bluetooth_devices_from_blacklist(void);
132 int _bt_dpm_clear_bluetooth_devices_from_whitelist(void);
133 int _bt_dpm_clear_bluetooth_uuids_from_blacklist(void);
134 int _bt_dpm_clear_bluetooth_uuids_from_whitelist(void);
135 int _bt_dpm_get_bluetooth_devices_from_blacklist(GArray **out_param1);
136 int _bt_dpm_get_bluetooth_devices_from_whitelist(GArray **out_param1);
137 int _bt_dpm_get_bluetooth_uuids_from_blacklist(GArray **out_param1);
138 int _bt_dpm_get_bluetooth_uuids_from_whitelist(GArray **out_param1);
139 int _bt_dpm_is_bluetooth_device_restriction_active(int *value);
140 int _bt_dpm_is_bluetooth_uuid_restriction_active(int *value);
141 int _bt_dpm_set_bluetooth_pairing_state(dpm_status_t value);
142 int _bt_dpm_get_bluetooth_pairing_state(int *value);
143 int _bt_dpm_set_bluetooth_profile_state(dpm_profile_t profile, dpm_status_t value);
144 int _bt_dpm_get_bluetooth_profile_state(dpm_profile_t profile, int *value);
145 int _bt_dpm_set_bluetooth_desktop_connectivity_state(dpm_status_t value);
146 int _bt_dpm_get_bluetooth_desktop_connectivity_state(int *value);
147 int _bt_dpm_set_bluetooth_discoverable_state(dpm_status_t value);
148 int _bt_dpm_get_bluetooth_discoverable_state(int *value);
149 int _bt_dpm_clear_bluetooth_devices_from_list(void);
150 int _bt_dpm_clear_bluetooth_uuids_from_list(void);
151 int _bt_dpm_set_bluetooth_limited_discoverable_state(dpm_status_t value);
152 int _bt_dpm_get_bluetooth_limited_discoverable_state(int *value);
153 int _bt_dpm_set_bluetooth_data_transfer_state(dpm_status_t value);
154 int _bt_dpm_get_allow_bluetooth_data_transfer_state(int *value);
155 int _bt_dpm_remove_bluetooth_devices_from_whitelist(bluetooth_device_address_t *bd_addr);
156 int _bt_dpm_remove_bluetooth_devices_from_blacklist(bluetooth_device_address_t *bd_addr);
157 int _bt_dpm_remove_bluetooth_uuids_from_whitelist(const char *uuids);
158 int _bt_dpm_remove_bluetooth_uuids_from_blacklist(const char *uuids);
162 #endif /* __cplusplus */
163 #endif /*_BT_SERVICE_DPM_H_*/
164 #endif /* #ifdef TIZEN_FEATURE_BT_DPM */