LowPowerLab Forum

Software support => Coding questions => Topic started by: Creotom on November 28, 2018, 01:54:57 PM

Title: boolean requestACK = false ?
Post by: Creotom 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;
Title: Re: boolean requestACK = false ?
Post by: Felix 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.
Title: Re: boolean requestACK = false ?
Post by: Creotom 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?
Title: Re: boolean requestACK = false ?
Post by: Felix on November 28, 2018, 03:42:05 PM
Well, what behavior do you expect?
And what's your code doing with that variable?
Title: Re: boolean requestACK = false ?
Post by: Creotom 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
Title: Re: boolean requestACK = false ?
Post by: TomWS 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.