File Info |
|---|
sharekit_api.h |
API definition file. |
Return Type | Method Name |
|---|---|
int | InitShareKit(void* handle) Initializes the Share Engine running environment. |
int | UnInitShareKit(void) Releases system resources. |
int | StartShareService(ShareRole role, void* handle) Enables the Huawei Share service. |
int | StopShareService(void) Disables the Huawei Share service. |
int | GetAvailableDevice(ShareDeviceInfo** devInfo, int* devNum) Searches for available devices. |
Int | TransFile(const ShareDeviceInfo* device, const ShareFileInfo* files) Sends files. |
void | CancelTransFile(void) Cancels file sending. |
int | ConfirmRecvFile(char *path) Accepts the file transfer request. |
void | RefuseRecvFile(void) Rejects file receiving. |
Method |
|---|
int InitShareKit(void* handle) |
Starts the request for initializing device resources for Share Engine. |
Parameters
Method Name | Parameter Description |
|---|---|
handle |
|
Return
Type | Description |
|---|---|
int | 0: Initialization is successful. -1: Initialization fails. |
Method |
|---|
int UninitShareKit(void) |
Releases system resources occupied by Share Engine. |
Return
Type | Description |
|---|---|
int | 0: Release is successful. -1: Release fails. |
Method |
|---|
int StartShareService(ShareRole role, void* handle) |
Starts the Huawei Share service so that Huawei phones can share files with the device using Huawei Share. |
Parameters
Method Name | Parameter Description |
|---|---|
role | Role in the share action: sender or receiver. |
handle |
|
Return
Type | Description |
|---|---|
int | 0: Service is enabled. -1: Service fails to be enabled. |
Method |
|---|
int StopShareService (void) |
Disables the Huawei Share service. |
Return
Type | Description |
|---|---|
int | 0: Service is disabled. -1: Service fails to be disabled. |
Method |
|---|
int GetAvailableDevice(ShareDeviceInfo** devInfo, int* devNum) |
Discovers available devices in close proximity using BLE advertising. |
Parameters
Method Name | Parameter Description |
|---|---|
devInfo | Output parameter: devices that have been found. |
devNum | Output parameter: number of found devices. |
Return
Type | Description |
|---|---|
Int | 0: Devices are obtained. -1: Failed to obtain devices. |
Method |
|---|
int TransFile(const ShareDeviceInfo* device, const ShareFileInfo* files) |
Selects a connected device to share specific files with it. |
Parameters
Method Name | Parameter Description |
|---|---|
device | Information about the receiving device, such as its MAC address. |
files | Information about the files to share. |
Return
Type | Description |
|---|---|
Int | 0: Request is rejected. -1: Failed to reject the request. |
Method |
|---|
int ConfirmFileRecv(char *path) |
Instructs Share Engine to receive files and store them to the specified path, after the user chooses to accept the file transfer request. |
Parameters
Method Name | Parameter Description |
|---|---|
path | File storage path. |
Return
Type | Description |
|---|---|
int | 0: Connection is successful. -1: Connection fails. |