一、DeviceInfo介紹
foundation/communication/dsoftbus/interfaces/kits/common/softbus_common.h
/**
* @brief Defines the device information returned by <b>IDiscoveryCallback</b>.
*
*/
typedef struct {
/** Device ID. Its maximum length is specified by {@link DISC_MAX_DEVICE_ID_LEN}. */
char devId[DISC_MAX_DEVICE_ID_LEN];
/** Account hash code. Its maximum length is specified by {@link MAX_ACCOUNT_HASH_LEN}. */
char accountHash[MAX_ACCOUNT_HASH_LEN];
/** Device type. For details, see {@link DeviceType}. */
DeviceType devType;
/** Device name. Its maximum length is specified by {@link DISC_MAX_DEVICE_NAME_LEN}. */
char devName[DISC_MAX_DEVICE_NAME_LEN];
/** Number of available connections */
unsigned int addrNum;
/** Connection information. For details, see {@link ConnectAddr}. */
ConnectionAddr addr[CONNECTION_ADDR_MAX];
/** Number of capabilities */
unsigned int capabilityBitmapNum;
/** Device capability bitmap.
* The maximum number of capabilities in the bitmap is specified by {@link DISC_MAX_CAPABILITY_NUM}.
*/
unsigned int capabilityBitmap[DISC_MAX_CAPABILITY_NUM];
/** Custom data. Its length is specified by {@link DISC_MAX_CUST_DATA_LEN}. */
char custData[DISC_MAX_CUST_DATA_LEN];
} DeviceInfo;
#ifdef __cplusplus
}
二、DeviceInfo字段介紹
序號 | 字段 | 類型 | 含義 |
1 | devId[DISC_MAX_DEVICE_ID_LEN] | char | 設(shè)備的ID |
2 | accountHash | ||
3 | devType | enum | 設(shè)備類型 |
4 | devName[DISC_MAX_DEVICE_NAME_LEN] | char | 設(shè)備名稱 |
5 | addrNum | int | 該設(shè)備可以連接地址數(shù)量 |
6 | addr[CONNECTION_ADDR_MAX] | ConnectionAddr | 具體的地址內(nèi)容 |
7 | capabilityBitmapNum | 此設(shè)備有多少能力 | |
8 | capabilityBitmap[DISC_MAX_CAPABILITY_NUM] | 支持哪幾種能力 | |
9 | custData[DISC_MAX_CUST_DATA_LEN] | 用戶自定義數(shù)據(jù) |
三、其他
3.1 devType類別文章來源:http://www.zghlxwxcb.cn/news/detail-434667.html
/**
* @brief Enumerates device types.
*
*/
typedef enum {
/* Smart speaker */
SMART_SPEAKER = 0x00,
/* PC */
DESKTOP_PC,
/* Laptop */
LAPTOP,
/* Mobile phone */
SMART_PHONE,
/* Tablet */
SMART_PAD,
/* Smart watch */
SMART_WATCH,
/* Smart car */
SMART_CAR,
/* Kids' watch */
CHILDREN_WATCH,
/* Smart TV */
SMART_TV,
} DeviceType;
3.2 DataBitMap結(jié)構(gòu)體文章來源地址http://www.zghlxwxcb.cn/news/detail-434667.html
/**
* @brief Enumerates supported capabilities published by a device.
*
*/
typedef enum {
/** MeeTime */會議
HICALL_CAPABILITY_BITMAP = 0,
/** Video reverse connection in the smart domain */智能域中的視頻反向連接
PROFILE_CAPABILITY_BITMAP = 1,
/** Gallery in Vision */視覺陳列室
HOMEVISIONPIC_CAPABILITY_BITMAP = 2,
/** cast+ cast+投屏技術(shù) */
CASTPLUS_CAPABILITY_BITMAP,
/** Input method in Vision */
AA_CAPABILITY_BITMAP,
/** Device virtualization tool package */
DVKIT_CAPABILITY_BITMAP,
/** Distributed middleware */
DDMP_CAPABILITY_BITMAP,
/** Osd capability 屏幕顯示*/
OSD_CAPABILITY_BITMAP
} DataBitMap;
到了這里,關(guān)于【001】OpenHarmony3.2 設(shè)備發(fā)現(xiàn)-設(shè)備管理結(jié)構(gòu)體DeviceInfo分析的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!