0

I'm trying to send packets over CoAP between two TI 2650 sensortags. I used the logic from the "er-rest-example" provided by contiki 3.0, that is:

coap_init_message(request, COAP_TYPE_CON, COAP_POST, 0);
coap_set_header_uri_path(request, url);
coap_set_payload(request, (uint8_t*)msg, sizeof(msg) - 1);
COAP_BLOCKING_REQUEST(&server_ip, REMOTE_PORT, request, client_chunk_handler);

When I started the program, it works as expected until the first time COAP_BLOCKING_REQUEST is called, at which point the program seems to freeze (doesn't react to button presses anymore). So I assume COAP_BLOCKING_REQUEST blocks until it receives a response, which is not suitable for my project. Can anyone confirm that?

UPDATE:

Going forward from that assumption, my question now is, what steps to I have to take to send out a packet? Do I use the coap_send_message function from er-coap.c or the coap_send_transaction function from er-coap-transaction.c?

I want to figure out what functions I have to call in which order to configure the packet correctly and then send it out with the correct function (which I guess would be one of the above).

Maybe there is some documentation out there that I haven't found yet and someone could point me to it?

Cheers

N. Plu
  • 11
  • 3
  • Looks like it blocks until the other side will send an ACK/RST packet. – eugene-nikolaev May 18 '18 at 13:23
  • That's what I thought, thanks for the confirmation. I suppose you looked at er-coap-engine.c to get a better idea of whats happening, @eugene-nikolaev? I added some information above/specified my question. – N. Plu May 22 '18 at 09:21
  • Unfortunately no, I just work with a java implementation heavily so it was like a strong guess. That's why it's a comment, not an answer. – eugene-nikolaev May 22 '18 at 11:09
  • Oh, alright, thanks anyways. – N. Plu May 23 '18 at 12:59

0 Answers0