We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
ReferencesSystemNetworkNetwork Boost KitC APIsHeader Filesnetwork_boost_handover.h

network_boost_handover.h

Phone5.1.0(18)+PC/2in15.1.0(18)+Tablet5.1.0(18)+

Overview

Declares APIs for network handover, and defines basic functions, structs, and constants.

File to include: <NetworkBoostKit/network_boost_handover.h>

Library: libnetwork_boost.so

System capability: SystemCapability.Communication.NetworkBoost.Core

Since: 5.1.0(18)

Related module: NetworkBoost

Summary

Structs

Expand
Struct Description
struct NetworkBoost_DataSpeedAction Defines the recommended packet transmission rate.
struct NetworkBoost_NetHandle Defines the handle of the data network.
struct NetworkBoost_HandoverStart Defines the information about the start of network handover.
struct NetworkBoost_HandoverComplete Defines the information about the end of network handover.
struct HMS_NetworkBoost_HandoverCallback Callback used to return the details about the start and end of a network handover.
struct NetworkBoost_MultiPathQuotaInfo Defines multi-network concurrency quota information.
struct NetworkBoost_MultiPathQuota Defines the quota usage information for multi-network concurrency.
struct NetworkBoost_MultiPathRequestResult Defines the multi-network concurrency request result.
struct NetworkBoost_MultiPathStateChange Defines multi-network concurrency status information.
struct NetworkBoost_MultiPathRecommendation Defines multi-network concurrency suggestion information.

Types

Expand
Type Description
typedef enum NetworkBoost_DataSpeedSimpleAction NetworkBoost_DataSpeedSimpleAction Defines the enumeration of simple suggested packet transmission policies.
typedef enum NetworkBoost_ErrorResult NetworkBoost_ErrorResult Defines the enumeration of network handover results.
typedef enum NetworkBoost_ReEstAction NetworkBoost_ReEstAction Defines the enumeration of link re-establishment types.
typedef struct NetworkBoost_DataSpeedAction NetworkBoost_DataSpeedAction Defines the recommended packet transmission rate.
typedef struct NetworkBoost_NetHandle NetworkBoost_NetHandle Defines the handle of the data network.
typedef struct NetworkBoost_HandoverStart NetworkBoost_HandoverStart Defines the information about the start of network handover.
typedef struct NetworkBoost_HandoverComplete NetworkBoost_HandoverComplete Defines the information about the end of network handover.
typedef enum NetworkBoost_HandoverMode NetworkBoost_HandoverMode Defines the enumeration of network handover modes.
typedef void(* HMS_NetworkBoost_OnHandoverStart) (NetworkBoost_HandoverStart *handoverStart) Defines the callback prototype triggered when the network handover starts.
typedef void(* HMS_NetworkBoost_OnHandoverComplete) (NetworkBoost_HandoverComplete *handoverComplete) Defines the callback prototype triggered when the network handover ends.
typedef struct HMS_NetworkBoost_HandoverCallback HMS_NetworkBoost_HandoverCallback Callback used to return the details about the start and end of a network handover.
typedef void (* HMS_NetworkBoost_OnMultiPathRequestResult)(NetworkBoost_MultiPathRequestResult* result) Defines the callback prototype for multi-network concurrency request results.
typedef void (* HMS_NetworkBoost_OnMultiPathStateChange)(NetworkBoost_MultiPathStateChange* multiPathState) Defines the callback prototype for multi-network concurrency status changes.
typedef void (* HMS_NetworkBoost_OnMultiPathRecommendation)(NetworkBoost_MultiPathRecommendation* recommendation) Defines the callback prototype for multi-network concurrency suggestion changes.

Enums

Expand
Enum Description
NetworkBoost_DataSpeedSimpleAction { NB_SIMPLEACTION_SUSPEND_DATA = 1, NB_SIMPLEACTION_DECREASE_DATA = 2, NB_SIMPLEACTION_INCREASE_DATA = 3, NB_SIMPLEACTION_KEEP_DATA = 4 } Defines the enumeration of simple suggested packet transmission policies.
NetworkBoost_ErrorResult { NB_ERROR_NONE = 0, NB_ERROR_HANDOVER_TIMEOUT = 1, NB_ERROR_NEW_PATH_ACTIVATION_FAILED = 2, NB_ERROR_ABORT = 3 } Defines the enumeration of network handover results.

NetworkBoost_ReEstAction {

NB_REEST_DEFAULT = 0, NB_REEST_QUERY_DNS = 1, NB_REEST_CHANGE_REMOTE_IP = 2, NB_REEST_CHANGE_IP_VERSION = 3,

NB_NO_EST = 4

}

Defines the enumeration of link re-establishment types.
NetworkBoost_HandoverMode { NB_MODE_DELEGATION = 0, NB_MODE_DISCRETION = 1 } Defines the enumeration of network handover modes.

NetworkBoost_PathState{

NB_PATH_IDLE = 0, NB_PATH_CONNECTED = 1, NB_PATH_SUSPENDED = 2

}

Defines the enumeration for the status of a data path other than the default path in multi-network concurrency.

NetworkBoost_MultiPathErrorResult{

NB_MULTIPATH_ERROR_NONE = 0,NB_MULTIPATH_ERROR_NETWORK_REFUSED = 1, NB_MULTIPATH_ERROR_TIMEOUT = 2, NB_MULTIPATH_ERROR_LOCAL = 3

}

Defines the enumeration of multi-network concurrency initiation results.

NetworkBoost_MultiPathChangeCause{

NB_MULTIPATH_CAUSE_REQUEST_NORMAL = 0, NB_MULTIPATH_CAUSE_RELEASE_NORMAL = 50, NB_MULTIPATH_CHANGE_CAUSE_RELEASE_NETWORK = 51, NB_MULTIPATH_CHANGE_CAUSE_RELEASE_USER_REFUSED = 52, NB_MULTIPATH_CAUSE_RELEASE_NO_QUOTA = 53, NB_MULTIPATH_CAUSE_RELEASE_POWER_CONSUMPTION = 54, NB_MULTIPATH_CHANGE_CAUSE_RELEASE_INSUFFICIENT_TRAFFIC = 55, NB_MULTIPATH_CHANGE_CAUSE_RELEASE_CONFLICT = 56, NB_MULTIPATH_CHANGE_CAUSE_RELEASE_SYS_FUSING = 57, NB_MULTIPATH_CHANGE_CAUSE_RELEASE_SYS_DEFAULT = 99, NB_MULTIPATH_CHANGE_CAUSE_SUSPEND_ENTER = 100, NB_MULTIPATH_CHANGE_CAUSE_SUSPEND_LEAVE = 101, NB_MULTIPATH_CHANGE_CAUSE_CONN_PROPERTIES_UPDATE = 102

}

Defines the enumeration of the reasons why multi-network concurrency status changes.

NetworkBoost_MultiPathState{

NB_MULTIPATH_IDLE = 0, NB_MULTIPATH_CREATING = 1, NB_MULTIPATH_CREATED = 2, NB_MULTIPATH_RELEASING = 3

}

Defines the enumeration for the status of multi-network concurrency.

NetworkBoost_MultiPathAction{

NB_MULTIPATH_ACTION_REQUEST = 0, NB_MULTIPATH_ACTION_RELEASE = 1

}

Defines the enumeration of suggested multi-network concurrency actions.

Functions

Expand
Function Description
int32_t HMS_NetworkBoost_RegisterHandoverChangeCallback (HMS_NetworkBoost_HandoverCallback *callback, uint32_t *callbackId) Registers the network handover callback.
int32_t HMS_NetworkBoost_UnregisterHandoverChangeCallback (uint32_t callbackId) Deregisters the network handover callback.
int32_t HMS_NetworkBoost_SetHandoverMode (NetworkBoost_HandoverMode mode) Defines the network handover mode. Your app can call the relevant API to change the network handover mode between delegation mode and proactive mode. The default mode is delegation. If the setting fails, the API will throw an exception.
int32_t HMS_NetworkBoost_GetMultiPathQuotaStats(NetworkBoost_MultiPathQuota *quota) Obtains the quota information of multi-network concurrency, including the used and remaining quotas.
int32_t HMS_NetworkBoost_RequestMultiPath(HMS_NetworkBoost_OnMultiPathRequestResult result) Initiates a multi-network concurrency request.
int32_t HMS_NetworkBoost_ReleaseMultiPath() Releases multi-network concurrency.
int32_t HMS_NetworkBoost_RegisterMultiPathStateChangeCallback(HMS_NetworkBoost_OnMultiPathStateChange callback, uint32_t *callbackId) Registers the callback triggered when a multi-network concurrency status change event occurs.
int32_t HMS_NetworkBoost_UnregisterMultiPathStateChangeCallback(uint32_t callbackId) Deregisters the callback triggered when a multi-network concurrency status change event occurs.
int32_t HMS_NetworkBoost_RegisterMultiPathRecommendationCallback(HMS_NetworkBoost_OnMultiPathRecommendation callback, uint32_t *callbackId) Registers the callback triggered when the multi-network concurrency suggestion provided by the device changes.
int32_t HMS_NetworkBoost_UnregisterMultiPathRecommendationCallback(uint32_t callbackId) Deregisters the callback triggered when the multi-network concurrency suggestion provided by the device changes.