Closed okvittem closed 2 years ago
You probably wonder how my code looks like - here is the header section. The COAP_BUF_MAX_SIZE is verified 1024 by printout in the loop();
`#define COAP_BUF_MAX_SIZE 1024
//#include
// time libraries //#include "RTC_SAMD21.h"
`
@okvittem Yes, you could change CoAP packet size with "COAP_BUF_MAX_SIZE" but you would be better consider about the IP/UDP packet fragment size for too big packet size. I think COAP_BUF_MAX_SIZE = 1024 is okay if it works well on your platform.
Defining COAP_BUF_MAX_SIZE in my program does not work. So it is probably not used when Arduino IDE is compiling coap-simple.cpp. I have changed it in coap-simple.h to make it be 1024,
It would be good to include the size limit on the main page. It would be even better to allow the size to be set in a constructor as an option.
Hi guys, okay, I will add MAX_PACKET_SIZE option to constructor. default value is 128, and it will be could change.
If you are going to add the buffer size option, I would also suggest that the buffer used in the loop not be allocated on each method call, but rather be allocated by the constructor.
now I update library. thank you guys.
Thank you for the quick changes! I look forward to putting them to use.
Hi, Is it possible to extend the coap packet data size ? It is set too 128 in coap-simple.h : COAP_BUF_MAX_SIZE 128 This is on an Arduino MKR NB 1500 using a uBlox SARA-R410M-02B modem. On bigger packets send just returns 0 msgid. The NB-IOT MTU seem to be 1600.