#5, First Floor, 4th Street , Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to create the COAP error message in contiki cooja simulator?
Description

To create error message in COAP using contiki cooja . If the requested URLs is not available or to restrict unauthorized access.

Source code

Step 1: er-coap.c
The file handling server receives data function
static int coap_receive(void)
erbium_status_code = NO_ERROR;//initialization
erbium_status_code=coap_parse_message(message,uip_appdata, uip_datalen());
//for example error messages
if(erbium_status_code == NO_ERROR)
erbium_status_code = NOT_IMPLEMENTED_5_01;
coap_error_message = “NoBlock1Support”;
erbium_status_code = PACKET_SERIALIZATION_ERROR;
erbium_status_code = SERVICE_UNAVAILABLE_5_03;
coap_error_message = “NoFreeTraBuffer”;
}