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 "softbus_def.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 #define TYPE_2IN1_ID 0xA2F 40 41 typedef struct { 42 char deviceName[DEVICE_NAME_BUF_LEN]; 43 char unifiedName[DEVICE_NAME_BUF_LEN]; 44 char nickName[DEVICE_NAME_BUF_LEN]; 45 char unifiedDefaultName[DEVICE_NAME_BUF_LEN]; 46 char deviceUdid[UDID_BUF_LEN]; 47 uint16_t deviceTypeId; 48 int32_t osType; 49 char osVersion[OS_VERSION_BUF_LEN]; 50 char deviceVersion[DEVICE_VERSION_SIZE_MAX]; 51 } DeviceBasicInfo; 52 53 int32_t LnnSetDeviceName(DeviceBasicInfo *info, const char *name); 54 const char *LnnGetDeviceName(const DeviceBasicInfo *info); 55 int32_t LnnGetDeviceTypeId(const DeviceBasicInfo *info, uint16_t *typeId); 56 int32_t LnnConvertDeviceTypeToId(const char *deviceType, uint16_t *typeId); 57 char *LnnConvertIdToDeviceType(uint16_t typeId); 58 59 #ifdef __cplusplus 60 } 61 #endif 62 63 #endif // LNN_DEVICE_INFO_H 64