• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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_DM_DEVICE_INFO_H
17 #define OHOS_DM_DEVICE_INFO_H
18 
19 #include <cstdint>
20 
21 #include "dm_app_image_info.h"
22 
23 #define DM_MAX_DEVICE_ID_LEN (96)
24 #define DM_MAX_DEVICE_NAME_LEN (128)
25 
26 namespace OHOS {
27 namespace DistributedHardware {
28 typedef enum DmDeviceType {
29     DEVICE_TYPE_UNKNOWN = 0x00,
30     DEVICE_TYPE_WIFI_CAMERA = 0x08,
31     DEVICE_TYPE_AUDIO = 0x0A,
32     DEVICE_TYPE_PC = 0x0C,
33     DEVICE_TYPE_PHONE = 0x0E,
34     DEVICE_TYPE_PAD = 0x11,
35     DEVICE_TYPE_WATCH = 0x6D,
36     DEVICE_TYPE_CAR = 0x83,
37     DEVICE_TYPE_TV = 0x9C,
38 } DmDeviceType;
39 
40 typedef enum DmDeviceState {
41     DEVICE_STATE_UNKNOWN = -1,
42     DEVICE_STATE_ONLINE = 0,
43     DEVICE_INFO_READY = 1,
44     DEVICE_STATE_OFFLINE = 2,
45     DEVICE_INFO_CHANGED = 3,
46 } DmDeviceState;
47 
48 typedef struct DmDeviceInfo {
49     char deviceId[DM_MAX_DEVICE_ID_LEN];
50     char deviceName[DM_MAX_DEVICE_NAME_LEN];
51     uint16_t deviceTypeId;
52     char networkId[DM_MAX_DEVICE_ID_LEN];
53 } DmDeviceInfo;
54 
55 typedef struct DmAuthParam {
56     std::string authToken;
57     std::string packageName;
58     std::string appName;
59     std::string appDescription;
60     int32_t authType;
61     int32_t business;
62     int32_t pincode;
63     int32_t direction;
64     int32_t pinToken;
65     DmAppImageInfo imageinfo;
66 } DmAuthParam;
67 } // namespace DistributedHardware
68 } // namespace OHOS
69 #endif // OHOS_DM_DEVICE_INFO_H
70