Android SDK
Wi-Fi Configuration
Bluetooth Configuration

BLE Provisioning

timeout is in seconds: 60 means 60 seconds. bindWithUid is nullable but has no default argument, so it must be supplied explicitly.

AI module requirement: when an AI module establishes its own binding relationship with the cloud, SDK provisioning must set bindWithUid = true. Sign in first, or supply a valid uid and token. This mode uses the current user’s bound-device list to confirm provisioning. Pass false for ordinary provisioning. The flag does not replace sign-in or mean that the app calls the device’s bind() method.

Scan and obtain the device before provisioning. For modules advertising 5 GHz provisioning support, the SDK selects the appropriate protocol automatically.

import com.gizwits.smart.sdk.bluetooth.bleCapability
import com.gizwits.smart.sdk.core.capacity.CapacityStatus
 
// Run in a coroutine; use true when the AI module binds itself in the cloud
val bindWithUid = true
val capability = device.bleCapability
if (capability.getModuleProfile()?.configured == false &&
    capability.getStatus() != CapacityStatus.OFFLINE) {
    val result = capability.provideWiFiCredentials(
        ssid = ssid,
        password = password,
        timeout = 60L,
        processHandler = { event -> println(event) },
        bindWithUid = bindWithUid
    )
    result.onSuccess {
        // Provisioning succeeded; the result is Unit. Obtain devices from device lists.
    }.onFailure { error -> println(error) }
}

Stop Provisioning

val stopResult = device.bleCapability.stopProvideWiFiCredentials()