Author Topic: boolean requestACK = false ?  (Read 247 times)

Creotom

  • Newbie
  • *
  • Posts: 20
boolean requestACK = false ?
« on: November 28, 2018, 01:54:57 PM »
Can anyone tell me what Boolean value for Request ACK does?
I am experimenting with the struct send receive examples and whether I set this value to true or false an ack is sent back after each send.

Code: [Select]
int TRANSMITPERIOD = 300; //transmit a packet to gateway so often (in ms)
byte sendSize=0;
boolean requestACK = false;
SPIFlash flash(8, 0xEF30); //EF40 for 16mbit windbond chip
RFM69 radio;
long lastPeriod = -1;

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5689
  • Country: us
    • LowPowerLab
Re: boolean requestACK = false ?
« Reply #1 on: November 28, 2018, 03:18:10 PM »
It's just a boolean (true/false) value that's used in radio.send functions, to request an ACK or not.

Creotom

  • Newbie
  • *
  • Posts: 20
Re: boolean requestACK = false ?
« Reply #2 on: November 28, 2018, 03:21:13 PM »
Cool thanks. But I don't get different behavior when I change it's value. Is this normal?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5689
  • Country: us
    • LowPowerLab
Re: boolean requestACK = false ?
« Reply #3 on: November 28, 2018, 03:42:05 PM »
Well, what behavior do you expect?
And what's your code doing with that variable?

Creotom

  • Newbie
  • *
  • Posts: 20
Re: boolean requestACK = false ?
« Reply #4 on: November 28, 2018, 03:44:40 PM »
It's the sample struct code. I haven't modified it.
Im on a mobile device now but I'll describe better what I mean tomorrow.
Thanks

TomWS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1854
Re: boolean requestACK = false ?
« Reply #5 on: November 28, 2018, 05:55:45 PM »
Cool thanks. But I don't get different behavior when I change it's value. Is this normal?
Yes, it is very 'normal'.  You've declared and set a variable that isn't used anywhere else.  Consequently there is no change in behavior to you program.

Now, if you had actually used it as a positional parameter to the send() method, then you might observe different behavior.