Hi,
I am looking at adding support for coap async response. I think I can send an empty ack after receiving the request.
Something like,
In packet.c -> handle_request():
else if (coap_error_code == MANUAL_RESPONSE)
{
/* Send an empty ack response */
coap_init_message(response, COAP_TYPE_ACK, 0, message->mid);
message_send(contextP, response, fromSessionH);
}
On the way out, I can prepare a response based on the original
message using an interface like,
void lwm2m_async_response(lwm2m_context_t * contextP,
uint8_t * payload,
coap_status_t * message,
void * fromSessionH)
{
/* Initiate a coap transaction based on the saved request (message) */
}
Couple of questions:
1)
If I
just save one request would that be enough? This would mean I am implementing
just a delay mechanism, but may be acceptable if the server sends requests
sequentially.
2)
What
happens if the async response was never sent ? Is there a timeout for
async response?
3)
How
can I initiate an async response or any coap response with payload of more than
1024 bytes ?
Thanks,
Prush