secureConnectDevice

Securely connects to a given Amazon Sidewalk device.

You can establish a secure connection by given SidewalkDevice.truncatedSmsn or SidewalkDevice.fullSmsn (if provided) received from scan;

val device = sidewalk.scan()
.filter { it is SidewalkResult.Success }
.map { (it as SidewalkResult.Success).value }
.first()
val result = sidewalk.secureConnectDevice(device.truncatedSmsn)
val connection = when (result) {
is SidewalkResult.Success -> result.value
is SidewalkResult.Failure -> throw result.exception
}

Return

The result after completing establishing the connection, it returns a SidewalkConnection object when succeeds, otherwise Throwable.

Parameters

smsn

The Sidewalk Manufacturing Serial Number (SMSN) of the device to attempt to connect to. The SMSN could be either 32-Byte hex string or 5-Byte hex string, for instance, "F123456789". String with invalid length or character will cause the process to fail directly.