#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 set payload in server side in COAP using contiki cooja?
Description

To know about how to set payload in server side in COAP using contiki cooja simulator.

Source code

Step 1: Open a file at location:
home/user/contiki/examples/er-rest-examples/er-example-client.c
Payload set for client side
coap_set_payload(request, (uint8_t *)msg, sizeof(msg) – 1);
function set payload,

Step 2: contiki/apps/er-coap/er-coap-engine.c

Payload set for sever side
For example,
Char * res_msg = “Pressure”
coap_set_payload(response, res_msg, strlen(res_msg)); /* a const char str[] and sizeof(str) produces larger code size */

Step 3: Run the cooja simulator