Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wakaama-dev] coap async response

hi Prush,

On Fri, Feb 17, 2017 at 6:00 PM, Prushothaman Palanichamy <prushp@xxxxxxxxx> wrote:

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.

I think with what you propose can handle more than one async request in parallel, I don't remember exactly but I think CoAP RFC put a limit of 1 request in parallel by default.

2)      What happens if the async response was never sent ? Is there a timeout for async response?

There is nothing specified here,  I think it's up to the server to manage that.

3)      How can I initiate an async response or any coap response with payload of more than 1024 bytes ?


You send a partial answer 2.05 with the first block (and the block2 option) and the server will came back to read all the blocks using more GET requests.
Then it's up to you to answer everytime with an async response or send the remaining block based on, for example, a cache.

 

Thanks,

Prush


_______________________________________________
wakaama-dev mailing list
wakaama-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wakaama-dev


Back to the top