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
TIMEOUTif the request timed out (took more than 2 minutes.) NabtoRuntimeException:- with error code
STOPPEDif the coap request or a parent object is stopped. NabtoRuntimeException:- with error code
NOT_CONNECTEDif the connection is not established yet.