Add payload marker within opencoap_send instead of in the app.
@@ -485,6 +485,11 @@ owerror_t opencoap_send(
tokenPos+=2;
}
+ if (msg->length > 0 ) { // contains payload, add payload marker
+ packetfunctions_reserveHeaderSize(msg,1);
+ msg->payload[0] = COAP_PAYLOAD_MARKER;
+ }
+
// fake run of opencoap_options_encode in order to get the necessary length
packetfunctions_reserveHeaderSize(msg, opencoap_options_encode(NULL, options, optionsLen, TRUE));
