SidewalkConnection

Represents a BLE connection with a Sidewalk Device. This class is created when Sidewalk Mobile SDK is able to create a secure connection with a Sidewalk Device.

Note: The connection might be terminated by the Sidewalk device if there's no traffic between them for an amount of time to prevent BLE resources occupation. The time is configurable by Sidewalk device.

Functions

Link copied to clipboard
abstract suspend fun disconnect(): SidewalkResult<Unit>

Close the connection with the Sidewalk device.

Link copied to clipboard
abstract fun isAvailable(): Boolean

Availability of the Sidewalk Connection.

Link copied to clipboard
abstract fun startCoverageTest(config: SidewalkCoverageTestConfig = SidewalkCoverageTestConfig()): Flow<SidewalkResult<SidewalkCoverageTestEvent>>

Start doing the coverage test

Link copied to clipboard
abstract suspend fun stopCoverageTest()

Stop the ongoing coverage test, if no test is running will do nothing.

Link copied to clipboard

Subscribe to receive SidewalkMessages from the Sidewalk device, or to receive a Throwable when error occurs or connection is terminated by the Sidewalk device.

Link copied to clipboard
abstract suspend fun write(message: SidewalkMessage): SidewalkResult<Unit>

Send a SidewalkMessage to the Sidewalk device.