1 /* 2 * Copyright (c) 2023-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_DP_DISTRIBUTED_DEVICE_PROFILE_CONSTANTS_H 17 #define OHOS_DP_DISTRIBUTED_DEVICE_PROFILE_CONSTANTS_H 18 19 #include <unordered_set> 20 #include <string> 21 #include <unistd.h> 22 23 #ifdef __LP64__ 24 constexpr const char* LIB_LOAD_PATH = "/system/lib64/"; 25 constexpr const char* DMS_LIB_LOAD_PATH = "/system/lib64/platformsdk/"; 26 #else 27 constexpr const char* LIB_LOAD_PATH = "/system/lib/"; 28 constexpr const char* DMS_LIB_LOAD_PATH = "/system/lib/platformsdk/"; 29 #endif 30 31 namespace OHOS { 32 namespace DistributedDeviceProfile { 33 /* DeviceProfile Attribute */ 34 const std::string DEVICE_ID = "deviceId"; 35 const std::string DEVICE_TYPE_ID = "deviceTypeId"; 36 const std::string DEVICE_TYPE_NAME = "deviceTypeName"; 37 const std::string DEVICE_NAME = "deviceIdName"; 38 const std::string MANUFACTURE_NAME = "manufactureName"; 39 const std::string DEVICE_MODEL = "deviceModel"; 40 const std::string STORAGE_CAPACITY = "storageCapacity"; 41 const std::string OS_SYS_CAPACITY = "osSysCapacity"; 42 const std::string OS_API_LEVEL = "osApiLevel"; 43 const std::string OS_VERSION = "osVersion"; 44 const std::string OS_TYPE = "osType"; 45 const std::string OH_PROFILE_SUFFIX = "_OH"; 46 /* ServiceProfile Attribute */ 47 const std::string SERVICE_NAME = "serviceName"; 48 const std::string SERVICE_TYPE = "serviceType"; 49 /* CharacteristicProfile Attribute */ 50 const std::string CHARACTERISTIC_KEY = "characteristicKey"; 51 const std::string CHARACTERISTIC_VALUE = "characteristicValue"; 52 /* TrustDeviceProfile Attribute */ 53 const std::string SUBSCRIBE_TRUST_DEVICE_PROFILE = "trust_device_profile"; 54 const std::string DEVICE_ID_TYPE = "deviceIdType"; 55 const std::string DEVICE_ID_HASH = "deviceIdHash"; 56 /* AccessControlProfile Attribute */ 57 const std::string ACCESS_CONTROL_ID = "accessControlId"; 58 const std::string ACCESSER_ID = "accesserId"; 59 const std::string ACCESSEE_ID = "accesseeId"; 60 const std::string TRUST_DEVICE_ID = "trustDeviceId"; 61 const std::string SESSION_KEY = "sessionKey"; 62 const std::string BIND_TYPE = "bindType"; 63 const std::string AUTHENTICATION_TYPE = "authenticationType"; 64 const std::string BIND_LEVEL = "bindLevel"; 65 const std::string STATUS = "status"; 66 const std::string VALID_PERIOD = "validPeriod"; 67 const std::string LAST_AUTH_TIME = "lastAuthTime"; 68 /* Accesser Attribute */ 69 const std::string ACCESSER_DEVICE_ID = "accesserDeviceId"; 70 const std::string ACCESSER_USER_ID = "accesserUserId"; 71 const std::string ACCESSER_ACCOUNT_ID = "accesserAccountId"; 72 const std::string ACCESSER_TOKEN_ID = "accesserTokenId"; 73 const std::string ACCESSER_BUNDLE_NAME = "accesserBundleName"; 74 const std::string ACCESSER_HAP_SIGNATURE = "accesserHapSignature"; 75 const std::string ACCESSER_BIND_LEVEL = "accesserBindLevel"; 76 /* Accessee Attribute */ 77 const std::string ACCESSEE_DEVICE_ID = "accesseeDeviceId"; 78 const std::string ACCESSEE_USER_ID = "accesseeUserId"; 79 const std::string ACCESSEE_ACCOUNT_ID = "accesseeAccountId"; 80 const std::string ACCESSEE_TOKEN_ID = "accesseeTokenId"; 81 const std::string ACCESSEE_BUNDLE_NAME = "accesseeBundleName"; 82 const std::string ACCESSEE_HAP_SIGNATURE = "accesseeHapSignature"; 83 const std::string ACCESSEE_BIND_LEVEL = "accesseeBindLevel"; 84 /* subscribe info */ 85 const std::string SA_ID = "saId"; 86 const std::string SUBSCRIBE_KEY = "subscribeKey"; 87 const std::string SUBSCRIBE_CHANGE_TYPES = "subscribeChangeTypes"; 88 /* syncOptions */ 89 const std::string SYNC_MODE = "syncMode"; 90 const std::string SYNC_DEVICE_IDS = "syncDevices"; 91 /* Interface Name */ 92 const std::string PUT_ACCESS_CONTROL_PROFILE = "PutAccessControlProfile"; 93 const std::string UPDATE_ACCESS_CONTROL_PROFILE = "UpdateAccessControlProfile"; 94 const std::string GET_ACCESS_CONTROL_PROFILE = "GetAccessControlProfile"; 95 const std::string DELETE_ACCESS_CONTROL_PROFILE = "DeleteAccessControlProfile"; 96 const std::string GET_TRUST_DEVICE_PROFILE = "GetTrustDeviceProfile"; 97 const std::string GET_ALL_TRUST_DEVICE_PROFILE = "GetAllTrustDeviceProfile"; 98 const std::string GET_ALL_ACCESS_CONTROL_PROFILE = "GetAllAccessControlProfile"; 99 const std::string PUT_SERVICE_PROFILE = "PutServiceProfile"; 100 const std::string PUT_SERVICE_PROFILE_BATCH = "PutServiceProfileBatch"; 101 const std::string PUT_CHARACTERISTIC_PROFILE = "PutCharacteristicProfile"; 102 const std::string PUT_CHARACTERISTIC_PROFILE_BATCH = "PutCharacteristicProfileBatch"; 103 const std::string GET_DEVICE_PROFILE = "GetDeviceProfile"; 104 const std::string GET_SERVICE_PROFILE = "GetServiceProfile"; 105 const std::string GET_CHARACTERISTIC_PROFILE = "GetCharacteristicProfile"; 106 const std::string DELETE_SERVICE_PROFILE = "DeleteServiceProfile"; 107 const std::string DELETE_CHARACTERISTIC_PROFILE = "DeleteCharacteristicProfile"; 108 const std::string SUBSCRIBE_DEVICE_PROFILE = "SubscribeDeviceProfile"; 109 const std::string UNSUBSCRIBE_DEVICE_PROFILE = "UnSubscribeDeviceProfile"; 110 const std::string SYNC_DEVICE_PROFILE = "SyncDeviceProfile"; 111 /* Common constants */ 112 constexpr int32_t MIN_STRING_LEN = 0; 113 constexpr int32_t MAX_STRING_LEN = 4096; 114 constexpr int64_t MIN_STORAGE_KB = 0; 115 constexpr int64_t MAX_STORAGE_KB = 5368709120; 116 constexpr int32_t MIN_OS_API_LEVEL = 0; 117 constexpr int32_t MAX_OS_API_LEVEL = 10000; 118 constexpr int32_t MIN_OS_TYPE = 0; 119 constexpr int32_t MAX_OS_TYPE = 10000; 120 constexpr int32_t MAX_PARAM_SIZE = 20; 121 constexpr int32_t MAX_PROFILE_SIZE = 10000; 122 constexpr int32_t MAX_DEVICE_SIZE = 1000; 123 constexpr int32_t MAX_SERVICE_SIZE = 1000; 124 constexpr int32_t MAX_CHAR_SIZE = 1000; 125 constexpr int32_t MAX_DB_SIZE = 1000; 126 constexpr int32_t MAX_DUMP_ARGS_SIZE = 1000; 127 constexpr int32_t MAX_LISTENER_SIZE = 100; 128 constexpr int32_t MAX_EVENT_HANDLER_SIZE = 50; 129 constexpr int32_t MAX_DB_RECORD_SIZE = 10000; 130 constexpr int32_t MAX_SUBSCRIBE_CHANGE_SIZE = 3; 131 constexpr int32_t MAX_INTERFACE_SIZE = 20; 132 constexpr int32_t MAX_SUBSCRIBE_INFO_SIZE = 500; 133 constexpr int32_t MAX_SYNC_RESULTS_SIZE = 50; 134 constexpr int32_t MAX_STATIC_CAPABILITY_SIZE = 100; 135 const std::string SEPARATOR = "#"; 136 const std::string DEV_PREFIX = "dev"; 137 const std::string SVR_PREFIX = "svr"; 138 const std::string CHAR_PREFIX = "char"; 139 const std::string USER_ID = "user_id"; 140 const std::string TOKEN_ID = "token_id"; 141 const std::string ALL_PROC = "all"; 142 constexpr int32_t NUM_1 = 1; 143 constexpr int32_t NUM_2 = 2; 144 constexpr int32_t NUM_3 = 3; 145 constexpr uint32_t NUM_1U = 1; 146 constexpr uint32_t NUM_8U = 8; 147 constexpr uint16_t CUR_SWITCH_LEN = 3; 148 const std::string DP_PKG_NAME = "ohos.deviceprofile"; 149 const std::string IS_NUMSTRING_RULES = "^[-+]?[0-9]+$"; 150 constexpr int32_t OHOS_TYPE = 10; 151 constexpr int32_t OHOS_TYPE_UNKNOWN = -1; 152 /* rdb constants */ 153 const std::string RDB_PATH = "/data/service/el1/public/database/distributed_device_profile_service/"; 154 const std::string DATABASE_NAME = "dp_rdb.db"; 155 constexpr int32_t RDB_VERSION = 1; 156 constexpr int32_t RDB_INIT_MAX_TIMES = 30; 157 constexpr int32_t RDB_INIT_INTERVAL_TIME = 100000; 158 /* TrustProfile Manager */ 159 const std::string USERID = "userId"; 160 const std::string BUNDLENAME = "bundleName"; 161 const std::string TOKENID = "tokenId"; 162 const std::string ACCOUNTID = "accountId"; 163 const std::string DEVICEID_EQUAL_CONDITION = "deviceId = ?"; 164 const std::string ACCESSCONTROLID_EQUAL_CONDITION = "accessControlId = ?"; 165 const std::string ACCESSERID_EQUAL_CONDITION = "accesserId = ? "; 166 const std::string ACCESSEEID_EQUAL_CONDITION = "accesseeId = ? "; 167 constexpr int32_t ROWCNT_INIT = -1; 168 constexpr int32_t RET_INIT = -1; 169 constexpr int32_t ROWCOUNT_INIT = -1; 170 constexpr int32_t CHANGEROWCNT_INIT = -1; 171 constexpr int32_t COLUMNINDEX_INIT = -1; 172 constexpr int32_t STATUS_INIT = 0; 173 constexpr int32_t BINDTYPE_INIT = -1; 174 constexpr int32_t BINDLEVEL_INIT = -1; 175 constexpr int32_t DELETEROWS_INIT = -1; 176 constexpr int32_t DELETE_ACCESSER_CONDITION = 1; 177 constexpr int32_t DELETE_ACCESSEE_CONDITION = 1; 178 constexpr int32_t DELETE_TRUST_CONDITION = 0; 179 constexpr int32_t MAX_SAID = 16777215; 180 constexpr int64_t ROWID_INIT = -1; 181 constexpr int64_t ACCESSERID_INIT = -1; 182 constexpr int64_t ACCESSEEID_INIT = -1; 183 constexpr int64_t ACCESSCONTROLID_INIT = -1; 184 const std::string CREATE_TURST_DEVICE_TABLE_SQL = "CREATE TABLE IF NOT EXISTS trust_device_table\ 185 (\ 186 deviceId TEXT PRIMARY KEY,\ 187 deviceIdType INTEGER,\ 188 deviceIdHash TEXT,\ 189 status INTEGER);"; 190 const std::string CREATE_ACCESS_CONTROL_TABLE_SQL = "CREATE TABLE IF NOT EXISTS access_control_table\ 191 (\ 192 accessControlId INTEGER PRIMARY KEY,\ 193 accesserId INTEGER,\ 194 accesseeId INTEGER,\ 195 trustDeviceId TEXT,\ 196 sessionKey TEXT,\ 197 bindType INTEGER,\ 198 authenticationType INTEGER,\ 199 deviceIdType INTEGER,\ 200 deviceIdHash TEXT,\ 201 status INTEGER,\ 202 validPeriod INTEGER,\ 203 lastAuthTime INTEGER,\ 204 bindLevel INTEGER);"; 205 const std::string CREATE_ACCESSER_TABLE_SQL = "CREATE TABLE IF NOT EXISTS accesser_table\ 206 (\ 207 accesserId INTEGER PRIMARY KEY,\ 208 accesserDeviceId TEXT,\ 209 accesserUserId INTEGER,\ 210 accesserAccountId TEXT,\ 211 accesserTokenId INTEGER,\ 212 accesserBundleName TEXT,\ 213 accesserHapSignature TEXT,\ 214 accesserBindLevel INTEGER\ 215 );"; 216 const std::string CREATE_ACCESSEE_TABLE_SQL = "CREATE TABLE IF NOT EXISTS accessee_table\ 217 (\ 218 accesseeId INTEGER PRIMARY KEY,\ 219 accesseeDeviceId TEXT,\ 220 accesseeUserId INTEGER,\ 221 accesseeAccountId TEXT,\ 222 accesseeTokenId INTEGER,\ 223 accesseeBundleName TEXT,\ 224 accesseeHapSignature TEXT,\ 225 accesseeBindLevel INTEGER\ 226 );"; 227 const std::string CREATE_TURST_DEVICE_TABLE_UNIQUE_INDEX_SQL = 228 "CREATE UNIQUE INDEX if not exists unique_trust_device_table ON trust_device_table \ 229 (\ 230 deviceId,\ 231 deviceIdType,\ 232 deviceIdHash,\ 233 status);"; 234 const std::string CREATE_ACCESS_CONTROL_TABLE_UNIQUE_INDEX_SQL = 235 "CREATE UNIQUE INDEX if not exists unique_access_control_table ON access_control_table \ 236 (\ 237 accesserId,\ 238 accesseeId,\ 239 trustDeviceId,\ 240 sessionKey,\ 241 bindType,\ 242 authenticationType,\ 243 deviceIdType,\ 244 deviceIdHash,\ 245 status,\ 246 validPeriod,\ 247 lastAuthTime,\ 248 bindLevel);"; 249 const std::string CREATE_ACCESSER_TABLE_UNIQUE_INDEX_SQL = 250 "CREATE UNIQUE INDEX if not exists unique_accesser_table ON accesser_table \ 251 (\ 252 accesserDeviceId,\ 253 accesserUserId,\ 254 accesserAccountId,\ 255 accesserTokenId,\ 256 accesserBundleName,\ 257 accesserHapSignature,\ 258 accesserBindLevel);"; 259 const std::string CREATE_ACCESSEE_TABLE_UNIQUE_INDEX_SQL = 260 "CREATE UNIQUE INDEX if not exists unique_accessee_table ON accessee_table \ 261 (\ 262 accesseeDeviceId,\ 263 accesseeUserId,\ 264 accesseeAccountId,\ 265 accesseeTokenId,\ 266 accesseeBundleName,\ 267 accesseeHapSignature,\ 268 accesseeBindLevel);"; 269 const std::string TRUST_DEVICE_TABLE = "trust_device_table"; 270 const std::string ACCESS_CONTROL_TABLE = "access_control_table"; 271 const std::string ACCESSER_TABLE = "accesser_table"; 272 const std::string ACCESSEE_TABLE = "accessee_table"; 273 const std::string SELECT_TRUST_DEVICE_TABLE = "SELECT * FROM trust_device_table"; 274 const std::string SELECT_TRUST_DEVICE_TABLE_WHERE_DEVICEID = 275 "SELECT * FROM trust_device_table WHERE deviceId = ?"; 276 const std::string SELECT_ACCESS_CONTROL_TABLE_WHERE_ACCESSCONTROLID = 277 "SELECT * FROM access_control_table WHERE accessControlId = ?"; 278 const std::string SELECT_ACCESS_CONTROL_TABLE_WHERE_ACCESSEEID = 279 "SELECT * FROM access_control_table WHERE accesseeId = ? "; 280 const std::string SELECT_ACCESS_CONTROL_TABLE_WHERE_ACCESSERID = 281 "SELECT * FROM access_control_table WHERE accesserId = ? "; 282 const std::string SELECT_ACCESS_CONTROL_TABLE_WHERE_BINDTYPE_AND_STATUS = 283 "SELECT * FROM access_control_table WHERE bindType = ? and status = ? "; 284 const std::string SELECT_ACCESS_CONTROL_TABLE = "SELECT * FROM access_control_table"; 285 const std::string SELECT_ACCESS_CONTROL_TABLE_WHERE_TRUSTDEVICEID = 286 "SELECT * FROM access_control_table WHERE trustDeviceId = ? "; 287 const std::string SELECT_ACCESS_CONTROL_TABLE_WHERE_TRUSTDEVICEID_AND_STATUS = 288 "SELECT * FROM access_control_table WHERE trustDeviceId = ? and status = ?"; 289 const std::string SELECT_ACCESS_CONTROL_TABLE_WHERE_STATUS = 290 "SELECT * FROM access_control_table WHERE status = ?"; 291 const std::string SELECT_ACCESSEE_TABLE_WHERE_ACCESSEEID = "SELECT * FROM accessee_table WHERE accesseeId = ? "; 292 const std::string SELECT_ACCESSER_TABLE_WHERE_ACCESSERID = "SELECT * FROM accesser_table WHERE accesserId = ? "; 293 const std::string SELECT_ACCESSER_TABLE_WHERE_ACCESSERID_AND_ACCESSERUSERID_ACCESSERTOKENID = 294 "SELECT * FROM accesser_table WHERE accesserId = ? and accesserUserId = ? and accesserTokenId = ?"; 295 const std::string SELECT_ACCESSEE_TABLE_WHERE_ACCESSEEID_AND_ACCESSEEUSEEID_ACCESSEETOKENID = 296 "SELECT * FROM accessee_table WHERE accesseeId = ? and accesseeUserId = ? and accesseeTokenId = ?"; 297 const std::string SELECT_ACCESSER_TABLE_WHERE_ACCESSERID_AND_ACCESSERUSERID_ACCESSERBUNDLENAME = 298 "SELECT * FROM accesser_table WHERE accesserId = ? and accesserUserId = ? and accesserBundleName = ?"; 299 const std::string SELECT_ACCESSEE_TABLE_WHERE_ACCESSEEID_AND_ACCESSEEUSEEID_ACCESSEEBUNDLENAME = 300 "SELECT * FROM accessee_table WHERE accesseeId = ? and accesseeUserId = ? and accesseeBundleName = ?"; 301 const std::string SELECT_ACCESSER_TABLE_WHERE_ACCESSERID_AND_ACCESSERUSERID_ACCESSERACCOUNTID = 302 "SELECT * FROM accesser_table WHERE accesserId = ? and accesserUserId = ? and accesserAccountId = ?"; 303 const std::string SELECT_ACCESSEE_TABLE_WHERE_ACCESSEEID_AND_ACCESSEEUSEEID_ACCESSEEACCOUNTID = 304 "SELECT * FROM accessee_table WHERE accesseeId = ? and accesseeUserId = ? and accesseeAccountId = ?"; 305 const std::string SELECT_ACCESSER_TABLE_WHERE_ACCESSERID_AND_ACCESSERUSERID = 306 "SELECT * FROM accesser_table WHERE accesserId = ? and accesserUserId = ? "; 307 const std::string SELECT_ACCESSEE_TABLE_WHERE_ACCESSEEID_AND_ACCESSEEUSERID = 308 "SELECT * FROM accessee_table WHERE accesseeId = ? and accesseeUserId = ? "; 309 const std::string SELECT_ACCESSER_TABLE_WHERE_ACCESSERID_AND_DEVICEID_AND_ACCESSERTOKENID = 310 "SELECT * FROM accesser_table WHERE accesserId = ? and accesserDeviceId = ? and accesserTokenId = ? "; 311 const std::string SELECT_ACCESSEE_TABLE_WHERE_ACCESSEEID_AND_DEVICEID_AND_ACCESSEETOKENID = 312 "SELECT * FROM accessee_table WHERE accesseeId = ? and accesseeDeviceId = ? and accesseeTokenId = ? "; 313 const std::string SELECT_ACCESSER_TABLE_WHERE_ACCESSERID_AND_ACCESSERDEVICEID = 314 "SELECT * FROM accesser_table WHERE accesserId = ? and accesserDeviceId = ? "; 315 const std::string SELECT_ACCESSEE_TABLE_WHERE_ACCESSEEID_AND_ACCESSEEDEVICEID = 316 "SELECT * FROM accessee_table WHERE accesseeId = ? and accesseeDeviceId = ? "; 317 const std::string SELECT_ACCESSER_TABLE_WHERE_ACCESSERID_AND_ACCESSERBUNDLENAME = 318 "SELECT * FROM accesser_table WHERE accesserId = ? and accesserBundleName = ? "; 319 const std::string SELECT_ACCESSEE_TABLE_WHERE_ACCESSEEID_AND_ACCESSEEBUNDLENAME = 320 "SELECT * FROM accessee_table WHERE accesseeId = ? and accesseeBundleName = ? "; 321 const std::string SELECT_ACCESSEE_TABLE = "SELECT * FROM accessee_table "; 322 const std::string SELECT_ACCESSER_TABLE = "SELECT * FROM accesser_table "; 323 const std::string SELECT_ACCESS_CONTROL_TABLE_WHERE_ALL = 324 "SELECT * FROM access_control_table WHERE accesserId = ? and accesseeId = ? and trustDeviceId = ? and \ 325 sessionKey = ? and bindType = ? and authenticationType = ? and deviceIdType = ? and deviceIdHash = ? \ 326 and status = ? and validPeriod = ? and lastAuthTime = ? and bindLevel = ? "; 327 const std::string SELECT_ACCESSER_TABLE_WHERE_ALL = 328 "SELECT * FROM accesser_table WHERE accesserDeviceId = ? and accesserUserId = ? and accesserAccountId = ? and \ 329 accesserTokenId = ? and accesserBundleName = ? and accesserHapSignature = ? and accesserBindLevel = ? "; 330 const std::string SELECT_ACCESSEE_TABLE_WHERE_ALL = 331 "SELECT * FROM accessee_table WHERE accesseeDeviceId = ? and accesseeUserId = ? and accesseeAccountId = ? and \ 332 accesseeTokenId = ? and accesseeBundleName = ? and accesseeHapSignature = ? and accesseeBindLevel = ? "; 333 /* SubscribeTrustInfoManager */ 334 const std::string SUBSCRIBE_TRUST_INFO_TABLE = "subscribe_trust_info_table"; 335 const std::string CREATE_SUBSCRIBE_TRUST_INFO_TABLE_SQL = 336 "CREATE TABLE IF NOT EXISTS subscribe_trust_info_table\ 337 (\ 338 saId INTEGER PRIMARY KEY,\ 339 subscribeTable TEXT,\ 340 );"; 341 const std::string CREATE_SUBSCRIBE_TRUST_INFO_TABLE_UNIQUE_INDEX_SQL = 342 "CREATE UNIQUE INDEX if not exists unique_subscribe_trust_info_table ON subscribe_trust_info_table \ 343 (said,\ 344 subscribeTable);"; 345 const std::string TRUST_DEVICE_DELETE = "TrustDeviceDelete"; 346 const std::string TRUST_DEVICE_ADD = "TrustDeviceAdd"; 347 const std::string TRUST_DEVICE_UPDATE = "TrustDeviceUpdate"; 348 /* event handler factory */ 349 const std::string DP_HANDLER = "dp_handler"; 350 const std::string EMPTY_STRING = ""; 351 /* switch attribute */ 352 const std::string SWITCH_CAPABILITY_PATH = "etc/deviceprofile/dp_switch_status_cfg.json"; 353 const std::string SWITCH_CALLERS = "DP_Callers"; 354 const std::string SWITCH_SERVICE_NAMES = "name"; 355 const std::string SWITCH_STATUS = "SwitchStatus"; 356 const std::string SWITCH_ON = "1"; 357 const std::string SWITCH_OFF = "0"; 358 const std::string SWITCH_OPERATE_PUT = "PutSwitch"; 359 const std::string SWITCH_OPERATE_GET = "GetSwitch"; 360 /* static attribute */ 361 const std::string STATIC_CAPABILITY_SVR_ID = "static_cap_svr_id"; 362 const std::string STATIC_CAPABILITY_CHAR_ID = "static_capability"; 363 const std::string STATIC_CAPABILITY_PATH = "etc/deviceprofile/dp_static_capability_cfg.json"; 364 const std::string STATIC_INFO_PATH = "etc/deviceprofile/dp_static_info_cfg.json"; 365 const std::string STATIC_CAPABILITY_ATTRIBUTE = "static_capability"; 366 const std::string STATIC_INFO = "static_info"; 367 const std::string DEFAULT_STATIC_VAL = "0"; 368 const std::string STATIC_CHARACTERISTIC_KEY = "static_capability"; 369 const std::string STATIC_CAPABILITY_VERSION = "staticCapabilityVersion"; 370 const std::string STATIC_CAPABILITY_VALUE = "staticCapabilityValue"; 371 const std::string DP_VERSION = "DPVersion"; 372 const std::string ABILITIES = "abilities"; 373 const std::string ABILITY_KEY = "abilityKey"; 374 const std::string ABILITY_VALUE = "abilityValue"; 375 constexpr char NOT_SUPPORT_STATIC_VAL = '0'; 376 constexpr char SUPPORT_STATIC_VAL = '1'; 377 const std::string STATIC_CAP_HANDLER_NAME = "service_name"; 378 const std::string STATIC_CAP_HANDLER_LOC = "handler_loc"; 379 const std::string DMS_HANDLER_LOC = "libdistributed_sdk.z.so"; 380 const std::string STATIC_VERSION_RULES = "^(\\d+\\.){3}\\d+$"; 381 constexpr uint32_t SWITCH_LENGTH_MAX = 24; 382 } // namespace DistributedDeviceProfile 383 } // namespace OHOS 384 #endif // OHOS_DP_DISTRIBUTED_DEVICE_PROFILE_CONSTANTS_H 385