Kotlin: Coap.awaitExecute()
DESCRIPTION
Execute a CoAP request.
This function is meant to be used in a Kotlin coroutine to suspend execution until the CoAP result is ready or an error occurs.
DECLARATION
suspend fun Coap.awaitExecute()
THROWS EXCEPTIONS
NabtoRuntimeException:
- with error code
TIMEOUT
if the request timed out (took more than 2 minutes.) NabtoRuntimeException:
- with error code
STOPPED
if the coap request or a parent object is stopped. NabtoRuntimeException:
- with error code
NOT_CONNECTED
if the connection is not established yet.