ProvisionerRepository

A class responsible for establishing connection and maintaining communication with a nRF 7 device.

It has several methods which allows for sending Wi-Fi credentials to an IoT device. The typical flow contains:

  1. start - Connecting to the device.

  2. readVersion&getStatus - Obtaining the device's version and status.

  3. startScan - Send START_SCAN command to the device and obtain Wi-Fi list.

  4. stopScan - After getting desired result the scanning should be stopped.

  5. setConfig - After selecting Wi-Fi and providing password, a provisioning data should be send to the DK.

  6. Observe connection status and eventually repeat step 4 if the password was wrong.

The device can be unprovisioned, if Status returns Wi-Fi info, by calling forgetConfig.

The connection should be closed after the job is done by calling release.

Inheritors

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract suspend fun forgetConfig()

Unprovision the DK - forget slected SSID, password, etc.

Link copied to clipboard
abstract suspend fun getStatus(): DeviceStatusDomain

Read device status.

Link copied to clipboard
abstract suspend fun readVersion(): VersionDomain

Read the current version.

Link copied to clipboard
abstract fun release()

Closes connection with the DK.

Link copied to clipboard

Provision the connected DK with data obtained from startScan + password.

Link copied to clipboard
abstract suspend fun start(device: BluetoothDevice): Flow<ConnectionStatus>

Connects and initialise bonding with a selected device.

Link copied to clipboard
abstract fun startScan(): Flow<ScanRecordDomain>

Start scanning and obtains available Wi-Fi list.

Link copied to clipboard
abstract suspend fun stopScan()

Stop scanning for available Wi-Fi's. Should be called after startScan.