• 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 LNN_DEVICE_INFO_H
17 #define LNN_DEVICE_INFO_H
18 
19 #include <stdint.h>
20 
21 #include "bus_center_info_key.h"
22 #include "softbus_bus_center.h"
23 #include "bus_center_adapter.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #define TYPE_UNKNOW_ID 0x00
30 #define TYPE_PHONE_ID 0x0E
31 #define TYPE_PAD_ID 0x11
32 #define TYPE_TV_ID 0x9C
33 #define TYPE_AUDIO_ID 0x0A
34 #define TYPE_CAR_ID 0x83
35 #define TYPE_WATCH_ID 0x6D
36 #define TYPE_IPCAMERA_ID 0X08
37 #define TYPE_PC_ID 0x0C
38 #define TYPE_SMART_DISPLAY_ID 0xA02
39 
40 typedef struct {
41     char deviceName[DEVICE_NAME_BUF_LEN];
42     char unifiedName[DEVICE_NAME_BUF_LEN];
43     char displayName[DEVICE_NAME_BUF_LEN];
44     char unifiedDefaultName[DEVICE_NAME_BUF_LEN];
45     char deviceUdid[UDID_BUF_LEN];
46     uint16_t deviceTypeId;
47 } DeviceBasicInfo;
48 
49 int32_t LnnSetDeviceName(DeviceBasicInfo *info, const char *name);
50 const char *LnnGetDeviceName(const DeviceBasicInfo *info);
51 int32_t LnnGetDeviceTypeId(const DeviceBasicInfo *info, uint16_t *typeId);
52 int32_t LnnConvertDeviceTypeToId(const char *deviceType, uint16_t *typeId);
53 char *LnnConvertIdToDeviceType(uint16_t typeId);
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
59 #endif // LNN_DEVICE_INFO_H