HarmonyOS Native SDK
API List

API List

The following tables list the main public integration APIs by HarmonyOS native module. Select “View usage” to open the corresponding description, guidance, and ArkTS example.

sdk

APIDescriptionUsage
new GizServerInfo()Creates an OpenAPI region configurationView usage
new GizProductInfo()Creates a ProductKey and ProductSecret configurationView usage
new GizConfiguration()Creates the SDK initialization configurationView usage
getProductWithProductKey()Finds a product in the initialization configurationView usage
GizSDKManager.initialize()Initializes the core SDKView usage
GizSDKManager.initSDK()Compatibility name for initialize()View usage
GizSDKManager.setDebug() / isDebug()Sets or reads SDK debug logging stateView usage
GizSDKManager.isInitialized()Checks whether the core SDK is initializedView usage
GizSDKManager.getConfiguration()Returns the current initialization configurationView usage
GizSDKManager.getUserManager()Returns the shared user managerView usage
GizSDKManager.getVersion()Returns the core HAR versionView usage
GizSDKManager.cleanCache()Clears logs and data point configuration cachesView usage
GizSDKManager.shutdown() / deregister()Releases core SDK resourcesView usage
subscribeUserState()Observes authentication status and user dataView usage
loginByAnonymous()Logs in an anonymous userView usage
loginWithAccount()Logs in with username and passwordView usage
sendMobileLoginVerifyCode() / loginWithMobile()Logs in with a mobile verification codeView usage
sendEmailLoginVerifyCode() / loginWithEmail()Logs in with an email verification codeView usage
getAuthorizeData() / getUserTokenStream()Reads or observes authorization dataView usage
refreshUserInfo()Refreshes the user profile from the cloudView usage
logout()Logs out and clears the user sessionView usage
registerWithAccount()Registers a username/password accountView usage
registerWithMobile() / registerWithPhone()Registers with a mobile number and verification codeView usage
registerWithEmail()Registers with email and a verification codeView usage
forgotWithMobile()Resets a password by mobile numberView usage
forgotWithEmail()Resets a password by emailView usage
subscribeBoundDeviceList() / refreshBoundDeviceList()Observes or refreshes cloud-bound devicesView usage
GizDeviceManager.getRegisteredDevices()Returns the unified device cacheView usage
GizDeviceManager.getBoundDevices()Returns cloud-bound devicesView usage
GizDeviceManager.getBluetoothDevices()Returns current BLE devicesView usage
GizDeviceManager.getLanDevices()Returns current LAN devicesView usage
GizDeviceManager.subscribeDeviceList()Observes the unified device listView usage
GizSDKManager.registerDevice()Registers a unified device by ProductKey and MACView usage
GizDevice.register()Registers a device with the cloudView usage
GizDevice.bind() / GizUserManager.bindDevice()Binds a device to the current userView usage
bindDeviceWithPasscode()Binds with Device ID and PasscodeView usage
GizDevice.updateDeviceInfo()Updates device alias and remarkView usage
GizDevice.unBind() / unbindDevice()Unbinds a deviceView usage
getName() / getRemark() / toJsonObject()Reads basic device information and a snapshotView usage
GizDevice.sendDataPoints()Writes data points over an automatically selected transportView usage
capability.sendDataPoints()Writes data points over a specified transportView usage
capability.readDataPoints()Reads data points over a specified transportView usage
subscribeDataPointEvents() / subscribeDataPoints()Observes device reports or current valuesView usage
capability.subscribeStatus()Observes transport capability statusView usage
GizState.getValue() / subscribe()Reads and observes SDK stateView usage
setLogDirectory() / getLogPath()Sets the log directory or reads the log pathView usage
GizSDKManager.feedback()Submits feedback with optional logsView usage
GizOpenApiErrorExposes OpenAPI error statusView usage

sdk_bluetooth

APIDescriptionUsage
GizBluetoothManager.initialize()Initializes the Bluetooth moduleView usage
subscribeBluetoothDeviceList()Observes the BLE discovery listView usage
startBleScan()Starts BLE scanningView usage
isScanning()Checks whether BLE scanning is activeView usage
stopBleScan()Stops BLE scanningView usage
getAdvertisement()Returns a parsed BLE advertisementView usage
getSession()Returns a low-level BLE sessionView usage
bleCapability.connect()Establishes and authenticates a GATT connectionView usage
bleCapability.disconnect()Disconnects a BLE deviceView usage
bleCapability.sendDataPoints()Writes data points over BLEView usage
bleCapability.readDataPoints()Reads data points over BLEView usage
bleCapability.getDeviceInfo()Reads device information over BLEView usage
bleCapability.queryResetFlag()Queries the reset flag over BLEView usage
bleCapability.provideWiFiCredentials()Runs the complete BLE Wi-Fi provisioning flowView usage
bleCapability.stopProvideWiFiCredentials()Cancels BLE provisioningView usage
GizBluetoothManager.configureNetwork()Low-level API that only sends Wi-Fi informationView usage
bleCapability.checkUpdate()Checks for BLE firmware updatesView usage
bleCapability.startUpgrade()Starts BLE OTAView usage
bleCapability.cancelUpgrade()Cancels BLE OTAView usage
getOtaManager()Returns the low-level GizBleOTAManagerView usage
isReady() / getStatus()Reads Bluetooth module statusView usage
getVersion()Returns the Bluetooth HAR versionView usage
shutdown()Releases Bluetooth module resourcesView usage

sdk_lan

APIDescriptionUsage
GizLanManager.initialize()Initializes the LAN moduleView usage
subscribeLanDeviceList()Observes the LAN device listView usage
startDiscovery()Starts UDP LAN discoveryView usage
refreshDiscovery()Refreshes LAN discovery immediatelyView usage
isDiscovering()Checks whether discovery is activeView usage
stopDiscovery()Stops discovery and closes socketsView usage
getProfile() / getSession()Returns the LAN profile or low-level sessionView usage
lanCapability.connect()Connects to a LAN deviceView usage
lanCapability.disconnect()Disconnects a LAN deviceView usage
lanCapability.sendDataPoints()Writes data points over LANView usage
lanCapability.readDataPoints()Reads data points over LANView usage
lanCapability.getDeviceInfo()Reads device information over LANView usage
lanCapability.queryResetFlag()Queries the reset flag over LANView usage
lanCapability.provideWiFiCredentials()Runs LAN Wi-Fi provisioningView usage
lanCapability.stopProvideWiFiCredentials()Cancels LAN provisioningView usage
isReady() / getStatus()Reads LAN module statusView usage
getVersion()Returns the LAN HAR versionView usage
shutdown()Releases LAN module resourcesView usage

sdk_mqtt

APIDescriptionUsage
GizMqttManager.initialize()Initializes MQTT and observes user, device, and network stateView usage
mqttCapability.subscribeStatus()Waits for a device cloud transport to become controllableView usage
mqttCapability.connect() / connectDevice()Explicitly enables MQTT subscriptions for one deviceView usage
mqttCapability.disconnect() / disconnectDevice()Explicitly disables MQTT subscriptions for one deviceView usage
mqttCapability.sendDataPoints() / sendDeviceDataPoints()Writes data points over MQTTView usage
mqttCapability.readDataPoints() / readDeviceDataPoints()Reads data points over MQTTView usage
subscribeDataPointEvents()Observes and identifies MQTT data point reportsView usage
mqttCapability.getDeviceInfo() / GizMqttManager.getDeviceInfo()Reads device versions from the cloud profileView usage
mqttCapability.queryResetFlag()Queries the reset flag over MQTTView usage
subscribeBindingEvents() / subscribeBindEvent()Observes MQTT device binding changesView usage
refreshBoundDeviceList()Refreshes the bound-device data used by MQTTView usage
isReady() / getStatus()Reads MQTT module status and diagnosticsView usage
getVersion()Returns the MQTT HAR versionView usage
shutdown()Closes services and releases MQTT resourcesView usage