EdgeWebrtcConnection.coapInvoke()

DESCRIPTION

Invoke a CoAP endpoint in the device using a WebRTC data channel on an established connection.

The CoAP content format is defined as a number. This must follow the CoAP content format specified by IANA. Common content formats are available in the CoapContentFormat enum. CoAP payloads are sent as an ArrayBuffer, for convenience it can be provided as a string to be converted by the library.

DECLARATION

  coapInvoke(method: CoapMethod, path: string, contentFormat?: number, payload?: ArrayBuffer | string): Promise<CoapResponse>

PARAMETERS

method:
CoAP method of the endpoint
path:
Path of the CoAP endpoint
contentFormat:
Content format of the payload if one is added
payload:
Payload of the CoAP request if needed

RETURNS

Promise resolved when a response is ready