• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2023 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     constexpr int32_t MODE_ENABLE = 0;
36     constexpr int32_t MODE_DISABLE = 1;
37     constexpr uint32_t MAX_SWITCH_SIZE = 256;
38     const std::string LOW_LATENCY_KEY = "identity";
39     const std::u16string DHMS_STUB_INTERFACE_TOKEN = u"ohos.distributedhardware.accessToken";
40     const std::string APP_ID = "dtbhardware_manager_service";
41     const std::string GLOBAL_CAPABILITY_ID = "global_capability_info";
42     const std::string GLOBAL_VERSION_ID = "global_version_info";
43     const std::string RESOURCE_SEPARATOR = "###";
44     const std::string DH_ID = "dh_id";
45     const std::string DEV_ID = "dev_id";
46     const std::string DEV_NAME = "dev_name";
47     const std::string DEV_TYPE = "dev_type";
48     const std::string DH_TYPE = "dh_type";
49     const std::string DH_ATTRS = "dh_attrs";
50     const std::string DH_SUBTYPE = "dh_subtype";
51     const std::string DH_LOG_TITLE_TAG = "DHFWK";
52     const std::string DH_VER = "dh_ver";
53     const std::string COMP_VER = "comp_ver";
54     const std::string NAME = "name";
55     const std::string TYPE = "type";
56     const std::string HANDLER = "handler";
57     const std::string SOURCE_VER = "source_ver";
58     const std::string SINK_VER = "sink_ver";
59     const std::string DH_TASK_NAME_PREFIX = "Task_";
60     const std::string DH_FWK_PKG_NAME = "ohos.dhardware";
61     const std::string DH_COMPONENT_VERSIONS = "componentVersions";
62     const std::string DH_COMPONENT_TYPE = "dhType";
63     const std::string DH_COMPONENT_SINK_VER = "version";
64     const std::string DH_COMPONENT_DEFAULT_VERSION = "1.0";
65     const std::string LOW_LATENCY_ENABLE = "low_latency_enable";
66     constexpr const char *DO_RECOVER = "DoRecover";
67     constexpr const char *SEND_ONLINE = "SendOnLine";
68     constexpr const char *DISABLE_TASK_INNER = "DisableTask";
69     constexpr const char *ENABLE_TASK_INNER = "EnableTask";
70     constexpr const char *OFFLINE_TASK_INNER = "OffLineTask";
71     constexpr const char *TRIGGER_TASK = "TriggerTask";
72     constexpr const char *EVENT_RUN = "EventRun";
73     constexpr const char *START_EVENT = "StartEvent";
74     constexpr const char *COMPONENTSLOAD_PROFILE_PATH =
75         "etc/distributedhardware/distributed_hardware_components_cfg.json";
76 
77     const uint32_t EVENT_VERSION_INFO_DB_RECOVER = 101;
78     const uint32_t EVENT_CAPABILITY_INFO_DB_RECOVER = 201;
79 } // namespace DistributedHardware
80 } // namespace OHOS
81 #endif
82