Author Topic: LWMesh: Meaning of control field in TX callback function  (Read 1135 times)

0 Members and 1 Guest are viewing this topic.

Offline pkr1Topic starter

  • Newbie
  • Posts: 3
  • Country: de
LWMesh: Meaning of control field in TX callback function
« on: June 21, 2017, 09:05:27 pm »
Hi,

I have a question of understanding regarding the TX callback function from the WSNDemo application.
What is the meaning of the control field marked in red / which values are possible values for this ?

static void appDataConf(NWK_DataReq_t *req)
{
 .........

  if (APP_COMMAND_PENDING == req->control)
  {
    SYS_TimerStart(&appCommandWaitTimer);
    appState = APP_STATE_WAIT_COMMAND_TIMER;
  }
  else
  {
    appState = APP_STATE_SENDING_DONE;
  }
}

Thank's

Peter
« Last Edit: June 21, 2017, 09:26:22 pm by pkr1 »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11236
  • Country: us
    • Personal site
Re: LWMesh: Meaning of control field in TX callback function
« Reply #1 on: June 21, 2017, 09:49:56 pm »
It is just an application specific field that is sent along with the ACK. This is just a way for the receiver to communicate some information to the sender in the acknowledgment frame itself, without sending another frame.

In this case this field is used to tell the device to not go to sleep right away, and wait for the additional commands from the gateway.

By default this field is just 1 byte, but you can extend it to be as big as you want.

The stack itself never looks at this field. It is passed directly from the application layer on one side  to the application on the other side.
Alex
 

Offline pkr1Topic starter

  • Newbie
  • Posts: 3
  • Country: de
Re: LWMesh: Meaning of control field in TX callback function
« Reply #2 on: June 21, 2017, 09:55:00 pm »
Ok, thank you Alex. I understand.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf