nabto_device_virtual_coap_request_get_response_payload()

DESCRIPTION

Get the coap response data.

The payload is available until nabto_device_coap_free is called.

DECLARATION

    NABTO_DEVICE_DECL_PREFIX NabtoDeviceError NABTO_DEVICE_API
        nabto_device_virtual_coap_request_get_response_payload(NabtoDeviceVirtualCoapRequest* coap, void** payload, size_t* payloadLength)

PARAMETERS

coap:
[in] the coap request object.
payload:
[out] start of the payload.
payloadLength:
[out] length of the payload

RETURNS

  • NABTO_DEVICE_EC_OK: if a payload exists and payload and payloadLength is set appropriately.
  • NABTO_DEVICE_EC_NO_DATA: if the response does not have a payload
  • NABTO_DEVICE_EC_INVALID_STATE: if no response is ready yet.