# Softbus ## **Overview** Provides high-speed, secure communication between devices. This module implements unified distributed communication capability management between nearby devices, and provides link-independent device discovery and transmission interfaces to support service publishing and data transmission. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Files
typedef struct PublishInfo Defines service provisioning information sent to a discovering device. |
|
typedef enum DeviceTypeEnum |
|
typedef struct IPublishCallback Defines the callbacks for successful and failed service publishing. |
|
typedef struct CommonDeviceInfo |
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 } |
|
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 } |
|
DeviceTypeEnum { UNKOWN = 0x00, PHONE = 0x0E, PAD = 0x11, TV = 0x9C, PC = 0x0C, AUDIO = 0x0A, CAR = 0x83, L0 = 0xF1, L1 = 0xF2 } |
|
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. |
PublishService (const char *moduleName, const struct PublishInfo *info, const struct IPublishCallback *cb) |
|
UnPublishService (const char *moduleName, int publishId) |
|
SetCommonDeviceInfo (const struct CommonDeviceInfo *devInfo, unsigned int num) |
Sets common device information, such as its ID, type, and name. |
CreateSessionServer (const char *mouduleName, const char *sessionName, struct ISessionListener *listener) |
Creates a session server based on a module name and session name. |
RemoveSessionServer (const char *mouduleName, const char *sessionName) |
Removes a session server based on a module name and session name. |
SendBytes (int sessionId, const void *data, unsigned int len) |
|
GetMySessionName (int sessionId, char *sessionName, unsigned int len) |
Obtains the session name registered by the local device based on the session ID. |
GetPeerSessionName (int sessionId, char *sessionName, unsigned int len) |
Obtains the session name registered by the peer device based on the session ID. |
GetPeerDeviceId (int sessionId, char *devId, unsigned int len) |
|
CloseSession (int sessionId) |
COMM_DEVICE_KEY_DEVID | |
COMM_DEVICE_KEY_DEVTYPE | |
COMM_DEVICE_KEY_DEVNAME | |
COMM_DEVICE_KEY_MAX |
HICALL_CAPABILITY_BITMAP | |
PROFILE_CAPABILITY_BITMAP | |
HOMEVISIONPIC_CAPABILITY_BITMAP | |
CASTPLUS_CAPABILITY_BITMAP | |
AA_CAPABILITY_BITMAP | |
DVKIT_CAPABILITY_BITMAP | |
DDMP_CAPABILITY_BITMAP |
UNKOWN | |
PHONE | |
PAD | |
TV | |
PC | |
AUDIO | |
CAR | |
L0 | |
L1 |
DISCOVER_MODE_PASSIVE | |
DISCOVER_MODE_ACTIVE |
AUTO | |
BLE | |
COAP | |
USB |
LOW | |
MID | |
HIGH | |
SUPER_HIGH |
PUBLISH_FAIL_REASON_NOT_SUPPORT_MEDIUM | |
PUBLISH_FAIL_REASON_PARAMETER_INVALID | |
PUBLISH_FAIL_REASON_UNKNOWN |
sessionId | Indicates the session ID. |
moduleName | Indicates the pointer to the module name, which can be used to check whether the session server is in this module. The value cannot be empty and can contain a maximum of 64 characters. |
sessionName | Indicates the pointer to the session name, which is the unique ID of the session server. The value cannot be empty and can contain a maximum of 64 characters. |
listener | Indicates the pointer to the session callback structure, which cannot be empty. |
sessionId | Indicates the session ID. |
sessionName | Indicates the pointer to the buffer for storing the session name. |
len | Indicates the length of the buffer. |
sessionId | Indicates the session ID. |
devId | Indicates the pointer to the buffer for storing the device ID. |
len | Indicates the length of the buffer. |
sessionId | Indicates the session ID. |
sessionName | Indicates the pointer to the buffer for storing the session name. |
len | Indicates the length of the buffer. |
moduleName | Indicates the pointer to the module name of the upper-layer service. The value contains a maximum of 63 bytes. |
info | Indicates the pointer to the service to publish. For details, see PublishInfo. |
cb | Indicates the pointer to the callback for service publishing. For details, see IPublishCallback. |
moduleName | Indicates the pointer to the name of the registered module, which can be used to check whether the session server is in this module. The value cannot be empty and can contain a maximum of 64 characters. |
sessionName | Indicates the pointer to the session name. The value cannot be empty and can contain a maximum of 64 characters. |
devInfo | Indicates the pointer to the device information array. |
2 | num Indicates the number of elements in the device information array. If the value is inconsistent with the length of the device information array, the program breaks down. |
sessionId | Indicates the session ID. |
data | Indicates the pointer to the data received. |
dataLen | Indicates the length of the data received. |
sessionId | Indicates the session ID. |
sessionId | Indicates the session ID. |