目录

network_boost_quality.h

Overview

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

File to include: <NetworkBoostKit/network_boost_quality.h>

Library: libnetwork_boost.so

System capability: SystemCapability.Communication.NetworkBoost.Core

Since: 5.1.0(18)

Related module: NetworkBoost

Summary

[h2]Structs

Struct Description
struct NetworkBoost_NetworkQos Defines network quality data that is returned.
struct NetworkBoost_NetworkQosArray Defines network quality change details.
struct NetworkBoost_WeakSignalPrediction Defines weak signal prediction information.
struct NetworkBoost_NetworkScene Defines the network scenario change information that is returned.

[h2]Macros

Macro Description
NETBOOST_MAX_PATH_NUM 4 Maximum number of paths for which network quality change information can be returned.
NB_BPS 1 1 bit/s.
NB_KBPS 1000 1 kbit/s.
NB_MBPS 1000000 1 Mbit/s.
NB_GBPS 1000000000 1 Gbit/s.
NB_TBPS 1000000000000 1 Tbit/s. To handle this, utilize the uint64_t data type to prevent overflow.

[h2]Types

Type Description
typedef enum NetworkBoost_RecommendedAction NetworkBoost_RecommendedAction Defines the enumeration of suggested data transmission policies.
typedef enum NetworkBoost_PathType NetworkBoost_PathType Defines the enumeration of data path types.
typedef enum NetworkBoost_Scene NetworkBoost_Scene Defines the enumeration of network scenario types.
typedef enum NetworkBoost_ServiceType NetworkBoost_ServiceType Defines the enumeration of app service types.
typedef enum NetworkBoost_QoeType NetworkBoost_QoeType Defines the enumeration of network quality data types of the app.
typedef struct NetworkBoost_NetworkQos NetworkBoost_NetworkQos Defines network quality data that is returned.
typedef struct NetworkBoost_NetworkQosArray NetworkBoost_NetworkQosArray Defines network quality change details.
typedef struct NetworkBoost_WeakSignalPrediction NetworkBoost_WeakSignalPrediction Defines weak signal prediction information.
typedef struct NetworkBoost_NetworkScene NetworkBoost_NetworkScene Defines the network scenario change information that is returned.
typedef void(* HMS_NetworkBoost_NetQosChange) (NetworkBoost_NetworkQosArray *networkQosArray) Defines the network quality change callback.
typedef void(* HMS_NetworkBoost_NetSceneChange) (NetworkBoost_NetworkScene *networkScene) Defines the network scenario change callback.

[h2]Enums

Enum Description

NetworkBoost_RecommendedAction {

NB_ACTION_DO_CACHING = 0, NB_ACTION_SUSPEND_DATA = 1, NB_ACTION_DECREASE_DATA = 2, NB_ACTION_INCREASE_DATA = 3,

NB_ACTION_KEEP_DATA = 4

}

Defines the enumeration of suggested data transmission policies.
NetworkBoost_PathType { NB_PATH_CELLULAR_PRIMARY = 0, NB_PATH_CELLULAR_SECONDARY = 1, NB_PATH_WIFI_PRIMARY = 2, NB_PATH_WIFI_SECONDARY = 3 } Defines the enumeration of data path types.
NetworkBoost_Scene { NB_SCENE_NORMAL = 0, NB_SCENE_CONGESTION = 1, NB_SCENE_FREQUENT_HANDOVER = 2, NB_SCENE_WEAK_SIGNAL = 3 } Defines the enumeration of network scenario types.

NetworkBoost_ServiceType {

NB_SERVICE_DEFAULT = 0, NB_SERVICE_BACKGROUND = 1, NB_SERVICE_REAL_TIME_VOICE = 2, NB_SERVICE_REAL_TIME_VIDEO = 3,

NB_SERVICE_CALL_SIGNALING = 4, NB_SERVICE_REAL_TIME_GAME = 5, NB_SERVICE_NORMAL_GAME = 6, NB_SERVICE_SHORT_VIDEO = 7,

NB_SERVICE_LONG_VIDEO = 8, NB_SERVICE_LIVE_STREAMING_ANCHOR = 9, NB_SERVICE_LIVE_STREAMING_WATCHER = 10, NB_SERVICE_DOWNLOAD = 11,

NB_SERVICE_UPLOAD = 12, NB_SERVICE_BROWSER = 13, NB_SERVICE_TRANSACTION = 14, NB_SERVICE_DETECTION = 15, NB_SERVICE_CLOUDSERVICE = 16, NB_SERVICE_VOICE_CONFERENCE = 17, NB_SERVICE_VIDEO_CONFERENCE = 18, NB_SERVICE_NAVIGATION = 19, NB_SERVICE_SECKILL_SERVICE = 20, NB_SERVICE_LOGIN = 21, NB_SERVICE_AUDIO = 22, NB_SERVICE_SHOPPING = 23

}

Defines the enumeration of app service types.

NetworkBoost_QoeType {

NB_QOE_GOOD = 0, NB_QOE_BAD_UNKNOWN = 1, NB_QOE_BAD_SERVER_ERROR = 2, NB_QOE_BAD_NO_DATA = 3,

NB_QOE_BAD_PACKET_LOST = 4, NB_QOE_BAD_PACKET_OUT_OF_ORDER = 5, NB_QOE_BAD_HIGH_JITTER = 6, NB_QOE_BAD_HIGH_LATENCY = 7

}

Defines the enumeration of network quality data types of the app.

[h2]Functions

Function Description
int32_t HMS_NetworkBoost_RegisterNetQosCallback (HMS_NetworkBoost_NetQosChange callback, uint32_t *callbackId) Registers the network quality information callback.
int32_t HMS_NetworkBoost_UnregisterNetQosCallback (uint32_t callbackId) Deregisters the network quality information callback.
int32_t HMS_NetworkBoost_RegisterNetSceneCallback (HMS_NetworkBoost_NetSceneChange callback, uint32_t *callbackId) Registers the network scenario change callback.
int32_t HMS_NetworkBoost_UnregisterNetSceneCallback (uint32_t callbackId) Deregisters the network scenario change callback.
int32_t HMS_NetworkBoost_ReportQoe (NetworkBoost_ServiceType serviceType, NetworkBoost_QoeType qoeType) Reports app data transmission quality.