Files
device_manager/common/include/dm_constants.h
T
renguang1116 34e0961d28 修复codecheck
Signed-off-by: renguang1116 <renguang@huawei.com>
2022-01-13 15:05:39 +08:00

178 lines
6.4 KiB
C++

/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef OHOS_DM_CONSTANTS_H
#define OHOS_DM_CONSTANTS_H
#include <string>
namespace OHOS {
namespace DistributedHardware {
const std::string DM_PKG_NAME = "ohos.distributedhardware.devicemanager";
const std::string DM_SESSION_NAME = "ohos.distributedhardware.devicemanager.resident";
const std::string DISCOVER_STATUS_KEY = "persist.distributed_hardware.device_manager.discover_status";
const std::string DISCOVER_STATUS_ON = "1";
const std::string DISCOVER_STATUS_OFF = "0";
const std::string AUTH_LOAD_JSON_KEY = "devicemanager_auth_components";
const std::string ADAPTER_LOAD_JSON_KEY = "devicemanager_adapter_components";
const std::string AUTH_JSON_TYPE_KEY = "AUTHENTICATE";
const std::string CPYPTO_JSON_TYPE_KEY = "CPYPTO";
const std::string PROFILE_JSON_TYPE_KEY = "PROFILE";
const std::string DECISION_JSON_TYPE_KEY = "DECISION";
const int32_t DM_NAPI_SUBSCRIBE_CAPABILITY_DDMP = 0;
const int32_t DM_NAPI_SUBSCRIBE_CAPABILITY_OSD = 1;
const int32_t LOG_MAX_LEN = 512;
const int32_t MIN_PIN_TOKEN = 10000000;
const int32_t MAX_PIN_TOKEN = 90000000;
const int32_t MIN_PIN_CODE = 100000;
const int32_t MAX_PIN_CODE = 999999;
const int32_t DISCOVER_STATUS_LEN = 20;
const int32_t COMMON_CALLBACK_MAX_SIZE = 200;
enum {
DM_OK = 0,
DM_FAILED = 1000,
DM_TIME_OUT,
DM_NOT_INIT,
DM_INT_MULTIPLE,
DM_INIT_FAILED,
DM_UNINIT_FAILED,
DM_POINT_NULL,
DM_INPUT_PARA_EMPTY,
DM_NOT_SYSTEM_APP,
DM_INVALID_VALUE,
DM_FLATTEN_OBJECT,
DM_MALLOC_ERROR,
DM_COPY_FAILED,
DM_WRITE_FAILED,
DM_DISCOVERY_FAILED,
DM_MAKE_SHARED_FAIL,
DM_SERVICE_NOT_READY,
DM_DEVICE_ALREADY_TRUSTED,
DM_IPC_FAILED = 2000,
DM_IPC_TRANSACTION_FAILED,
DM_IPC_FLATTEN_OBJECT,
DM_IPC_COPY_FAILED,
DM_IPC_SEND_REQUEST_FAILED,
DM_IPC_NOT_REGISTER_FUNC,
DM_IPC_RESPOND_ERROR,
DM_DISCOVERY_REPEATED,
DM_AUTH_NOT_SUPPORT,
DM_AUTH_BUSINESS_BUSY,
DM_AUTH_INPUT_FAILED,
DM_AUTH_STATE_FAILED,
DM_AUTH_DEVICE_AUTHED,
DM_AUTH_OPEN_SESSION_FAILED,
DM_AUTH_PEER_REJECT,
DM_AUTH_NOT_AUTH,
DM_SOFTBUS_FAILED = 3000,
DM_SOFTBUS_CREATE_SESSION_SERVER_FAILED,
DM_HICHAIN_FAILED = 4000,
DM_HICHAIN_GROUP_CREATE_FAILED,
DM_HICHAIN_MEMBER_ADD_FAILED,
DM_HICHAIN_CREATE_CHANNEL_FAILED,
};
const std::string TARGET_PKG_NAME_KEY = "targetPkgName";
const std::string HOST_PKG_NAME_KEY = "hostPackageName";
const std::string TAG_REQUESTER = "REQUESTER";
const std::string TAG_TOKEN = "TOKEN";
const std::string TAG_HOST = "HOST";
const std::string TAG_TARGET = "TARGET";
const std::string TAG_VISIBILITY = "VISIBILITY";
const std::string TAG_GROUPIDS = "GROUPIDLIST";
const std::string TAG_REPLY = "REPLY";
const std::string TAG_NET_ID = "NETID";
const std::string TAG_GROUP_ID = "groupId";
const std::string TAG_GROUP_NAME = "GROUPNAME";
const std::string TAG_REQUEST_ID = "REQUESTID";
const std::string TAG_DEVICE_ID = "DEVICEID";
const std::string TAG_LOCAL_DEVICE_ID = "LOCALDEVICEID";
const std::string TAG_DEVICE_TYPE = "DEVICETYPE";
const std::string TAG_APP_NAME = "APPNAME";
const std::string TAG_APP_DESCRIPTION = "APPDESC";
const std::string TAG_APP_ICON = "APPICON";
const std::string TAG_APP_THUMBNAIL = "APPTHUM";
const std::string TAG_INDEX = "INDEX";
const std::string TAG_SLICE_NUM = "SLICE";
const std::string TAG_THUMBNAIL_SIZE = "THUMSIZE";
const std::string TAG_AUTH_TYPE = "AUTHTYPE";
const std::string TAG_CRYPTO_SUPPORT = "CRYPTOSUPPORT";
const std::string TAG_CRYPTO_NAME = "CRYPTONAME";
const std::string TAG_CRYPTO_VERSION = "CRYPTOVERSION";
const std::string TAG_VER = "ITF_VER";
const std::string TAG_TYPE = "MSG_TYPE";
const std::string DM_ITF_VER_1_0 = "1.0";
const std::string DM_ITF_VER = "1.1";
const std::string TAG = "DM_MSG_CODEC";
const std::string APP_NAME_KEY = "appName";
const std::string APP_DESCRIPTION_KEY = "appDescription";
const std::string APP_ICON_KEY = "appIcon";
const std::string APP_THUMBNAIL_KEY = "appThumbnailKey";
const std::string APP_THUMBNAIL_LEN = "appThumbnailLen";
const std::string APP_THUMBNAIL = "appThumbnail";
const std::string CANCEL_DISPLAY_KEY = "cancelPinCodeDisplay";
const int32_t MSG_MAX_SIZE = 45 * 1024;
const int32_t AUTH_REPLY_ACCEPT = 0;
const int32_t ENCRYPT_TAG_LEN = 32;
// pin
const int32_t DISPLAY_OWNER_SYSTEM = 0;
const int32_t DISPLAY_OWNER_OTHER = 1;
const int32_t BUSINESS_FA_MIRGRATION = 0;
const int32_t BUSINESS_RESOURCE_ACCESS = 1;
// json
const std::string AUTH_TYPE = "authType";
const std::string TOKEN = "token";
const std::string PIN_TOKEN = "pinToken";
const std::string PIN_CODE_KEY = "pinCode";
const int32_t AUTH_TYPE_PIN = 1;
const int32_t AUTH_TYPE_SCAN = 2;
const int32_t AUTH_TYPE_TOUCH = 3;
const int32_t DEFAULT_PIN_CODE = 0;
const int32_t DEFAULT_PIN_TOKEN = 0;
// Softbus
const int32_t SOFTBUS_CHECK_INTERVAL = 100000; // 100ms
const uint32_t SOFTBUS_SUBSCRIBE_ID_PREFIX_LEN = 16;
const int32_t SOFTBUS_SUBSCRIBE_ID_MASK = 0x0000FFFF;
const int32_t SOFTBUS_DISCOVER_DEVICE_INFO_MAX_SIZE = 20;
const int32_t AUTH_SESSION_SIDE_SERVER = 0;
const int32_t AUTH_SESSION_SIDE_CLIENT = 1;
const static char *DM_CAPABILITY_OSD = "osdCapability";
// HiChain
const int32_t DEVICE_UUID_LENGTH = 65;
const int32_t GROUP_TYPE_IDENTICAL_ACCOUNT_GROUP = 1;
const int32_t GROUP_TYPE_PEER_TO_PEER_GROUP = 256;
const int32_t GROUP_VISIBILITY_PUBLIC = -1;
const int64_t MIN_REQUEST_ID = 1000000000;
const int64_t MAX_REQUEST_ID = 9999999999;
const int32_t FIELD_EXPIRE_TIME_VALUE = 7;
const int32_t GROUP_VISIBILITY_IS_PUBLIC = -1;
const int32_t GROUP_VISIBILITY_IS_PRIVATE = 0;
const std::string DEVICE_ID = "DEVICE_ID";
const std::string WIFI_IP = "WIFI_IP";
const std::string WIFI_PORT = "WIFI_PORT";
const std::string BR_MAC = "BR_MAC";
const std::string BLE_MAC = "BLE_MAC";
const std::string ETH_IP = "ETH_IP";
const std::string ETH_PORT = "ETH_PORT";
} // namespace DistributedHardware
} // namespace OHOS
#endif