• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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_DISTRIBUTED_HARDWARE_CONSTANTS_H
17 #define OHOS_DISTRIBUTED_HARDWARE_CONSTANTS_H
18 
19 #include <string>
20 #include <unistd.h>
21 
22 namespace OHOS {
23 namespace DistributedHardware {
24     constexpr int32_t LOG_MAX_LEN = 4096;
25     constexpr int32_t ENABLE_TIMEOUT_MS = 1000;
26     constexpr int32_t DISABLE_TIMEOUT_MS = 500;
27     constexpr uint32_t MAX_MESSAGE_LEN = 40 * 1024 * 1024;
28     constexpr uint32_t MIN_MESSAGE_LEN = 0;
29     constexpr uint32_t MAX_ID_LEN = 256;
30     constexpr uint32_t MAX_TOPIC_SIZE = 128;
31     constexpr uint32_t MAX_LISTENER_SIZE = 256;
32     constexpr uint32_t MAX_COMP_SIZE = 128;
33     constexpr uint32_t MAX_DB_RECORD_SIZE = 10000;
34     constexpr uint32_t MAX_ONLINE_DEVICE_SIZE = 10000;
35     const std::u16string DHMS_STUB_INTERFACE_TOKEN = u"ohos.distributedhardware.accessToken";
36     const std::string COMPONENTSLOAD_PROFILE_PATH =
37         R"(/vendor/etc/distributedhardware/distributed_hardware_components_cfg.json)";
38     const std::string APP_ID = "dtbhardware_manager_service";
39     const std::string GLOBAL_CAPABILITY_ID = "global_capability_info";
40     const std::string GLOBAL_VERSION_ID = "global_version_info";
41     const std::string RESOURCE_SEPARATOR = "###";
42     const std::string DH_ID = "dh_id";
43     const std::string DEV_ID = "dev_id";
44     const std::string DEV_NAME = "dev_name";
45     const std::string DEV_TYPE = "dev_type";
46     const std::string DH_TYPE = "dh_type";
47     const std::string DH_ATTRS = "dh_attrs";
48     const std::string DH_LOG_TITLE_TAG = "DHFWK";
49     const std::string DH_VER = "dh_ver";
50     const std::string COMP_VER = "comp_ver";
51     const std::string NAME = "name";
52     const std::string TYPE = "type";
53     const std::string HANDLER = "handler";
54     const std::string SOURCE_VER = "source_ver";
55     const std::string SINK_VER = "sink_ver";
56     const std::string DH_TASK_NAME_PREFIX = "Task_";
57     const std::string DH_FWK_PKG_NAME = "ohos.dhardware";
58     const std::string DH_COMPONENT_VERSIONS = "componentVersions";
59     const std::string DH_COMPONENT_TYPE = "dhType";
60     const std::string DH_COMPONENT_SINK_VER = "version";
61     const std::string DH_COMPONENT_DEFAULT_VERSION = "1.0";
62 } // namespace DistributedHardware
63 } // namespace OHOS
64 #endif
65