1 Star 0 Fork 4.9K

Cain / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
discovery_service-h.md 17.56 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

discovery_service.h

Overview

Related Modules:

Softbus

Description:

Declares unified device service publishing interfaces.

This file provides capabilities related to device service publishing, including publishing services, unpublishing services, and setting device parameters. After multiple nearby devices are discovered and networked, these interfaces can be used to perform service publishing-related operations.

Since:

1.0

Version:

1.0

Summary

Data Structures

Data Structure Name

Description

PublishInfo

Defines service provisioning information sent to a discovering device.

CapabilityMap

Defines the mapping between supported capabilities and bitmaps.

DeviceMap

Defines the mappings between the device type enumerations and device type names.

IPublishCallback

Defines the callbacks for successful and failed service publishing.

CommonDeviceInfo

Defines the type and content of a device to set.

Typedefs

Typedef Name

Description

PublishInfo

typedef struct PublishInfo 

Defines service provisioning information sent to a discovering device.

DeviceType

typedef enum DeviceTypeEnum 

Enumerates device types.

IPublishCallback

typedef struct IPublishCallback 

Defines the callbacks for successful and failed service publishing.

CommonDeviceInfo

typedef struct CommonDeviceInfo 

Defines the type and content of a device to set.

Enumerations

Enumeration Name

Description

ExchanageMedium { AUTO = 0, BLE = 1, COAP = 2, USB = 3 }

Enumerates media, such as Bluetooth, Wi-Fi, and USB, used for publishing services.

ExchangeFre { LOW = 0, MID = 1, HIGH = 2, SUPER_HIGH = 3 }

Enumerates frequencies for publishing services. This enumeration is involved only in Bluetooth and is not supported currently.

DiscoverMode { DISCOVER_MODE_PASSIVE = 0x55, DISCOVER_MODE_ACTIVE = 0xAA }

Enumerates the modes in which services are published. The publishing service supports the passive mode. Lite devices support the passive mode only.

PublishFailReason { PUBLISH_FAIL_REASON_NOT_SUPPORT_MEDIUM = 1, PUBLISH_FAIL_REASON_PARAMETER_INVALID = 2, PUBLISH_FAIL_REASON_UNKNOWN = 0xFF }

Enumerates failure reasons for publishing services.

DataBitMap {   HICALL_CAPABILITY_BITMAP = 0, PROFILE_CAPABILITY_BITMAP = 1, HOMEVISIONPIC_CAPABILITY_BITMAP = 2, CASTPLUS_CAPABILITY_BITMAP,   AA_CAPABILITY_BITMAP, DVKIT_CAPABILITY_BITMAP, DDMP_CAPABILITY_BITMAP }

Enumerates supported capabilities published by a device.

DeviceTypeEnum {   UNKOWN = 0x00, PHONE = 0x0E, PAD = 0x11, TV = 0x9C,   PC = 0x0C, AUDIO = 0x0A, CAR = 0x83, L0 = 0xF1,   L1 = 0xF2 }

Enumerates device types.

CommonDeviceKey { COMM_DEVICE_KEY_DEVID = 0, COMM_DEVICE_KEY_DEVTYPE = 1, COMM_DEVICE_KEY_DEVNAME = 2, COMM_DEVICE_KEY_MAX }

Enumerates device information, such as its ID, type, and name.

Functions

Function Name

Description

PublishService (const char *moduleName, const struct PublishInfo *info, const struct IPublishCallback *cb)

int 

Publishes a service to the discovering device in the LAN.

UnPublishService (const char *moduleName, int publishId)

int 

Unpublishes a service based on the publicId and moduleName.

SetCommonDeviceInfo (const struct CommonDeviceInfo *devInfo, unsigned int num)

int 

Sets common device information, such as its ID, type, and name.

1
https://gitee.com/cain_qin/docs.git
git@gitee.com:cain_qin/docs.git
cain_qin
docs
docs
master

搜索帮助