SidewalkConnection

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

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

Types

Link copied to clipboard

Constants defined and used in Amazon Sidewalk Mobile SDK for SidewalkConnection.uploadDeviceMetrics settings.

Functions

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

Close the connection with the Amazon Sidewalk device.

Link copied to clipboard
abstract fun isAvailable(): Boolean

Availability of the Amazon 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 Amazon Sidewalk device, or to receive a Throwable when error occurs or connection is terminated by the Amazon Sidewalk device.

Link copied to clipboard
abstract suspend fun uploadDeviceMetrics(@IntRange(from = 3000, to = 10000) timeoutMillis: Long = READ_METRIC_TIMEOUT_MIN): SidewalkResult<Unit>

Uploads device Metrics to the Amazon Sidewalk cloud.

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

Send a SidewalkMessage to the Amazon Sidewalk device.