error_t coapServerFormatReset(CoapServerContext *context, uint16_t mid)
{
   CoapMessageHeader *header;

   //Point to the CoAP response header
   header = (CoapMessageHeader *) context->response.buffer;

   //Format Reset message
   header->version = COAP_VERSION_1;
   header->type = COAP_TYPE_RST;
   header->tokenLen = 0;
   header->code = COAP_CODE_EMPTY;

   //The Reset message message must echo the message ID of the confirmable
   //message and must be empty (refer to RFC 7252, section 4.2)
   header->mid = htons(mid);

   //Set the length of the CoAP message
   context->response.length = sizeof(CoapMessageHeader);

   //Sucessful processing
   return NO_ERROR;
}
The product receives input or data, but it does
        not validate or incorrectly validates that the input has the
        properties that are required to process the data safely and
        correctly.