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 38 typedef struct { 39 char deviceName[DEVICE_NAME_BUF_LEN]; 40 char deviceUdid[UDID_BUF_LEN]; 41 uint16_t deviceTypeId; 42 } DeviceBasicInfo; 43 44 int32_t LnnSetDeviceName(DeviceBasicInfo *info, const char *name); 45 const char *LnnGetDeviceName(const DeviceBasicInfo *info); 46 int32_t LnnGetDeviceTypeId(const DeviceBasicInfo *info, uint16_t *typeId); 47 int32_t LnnConvertDeviceTypeToId(const char *deviceType, uint16_t *typeId); 48 char *LnnConvertIdToDeviceType(uint16_t typeId); 49 50 #ifdef __cplusplus 51 } 52 #endif 53 54 #endif // LNN_DEVICE_INFO_H