Go Down

Topic: int ret = SigFox.endPacket(); (Read 1 time) previous topic - next topic

pietervannuffel

May 29, 2017, 04:41 pm Last Edit: Jun 06, 2017, 09:30 pm by pietervannuffel
What is the result of the SigFox.endPacket() function?

In the Sigfox Arduino libraries documentation, you can read the next information:

Quote
Returns an int: 1 if the packet was sent successfully, 0 if there was an error

 if (ret == 1)
   Serial.println("OK");
 else
    Serial.println("KO");
 while (1);
In the "Event trigger" example you find:

Quote
if (ret > 0) {
      Serial1.println("No transmission");
} else {
      Serial1.println("Transmission ok");
}
Which is correct?

facchinm

Hi pietervannuffel,
thanks for spotting this! The EventTrigger example is correct, the function returns 0 if the transmission is ok.
I'll change the documentation of the other page accordingly! Thanks again!

zwanglos

#2
Jul 18, 2017, 04:40 am Last Edit: Jul 18, 2017, 05:31 am by zwanglos
Hey facchinm,

+1.

Short reminder, the documentation (https://www.arduino.cc/en/Reference/SigFoxEndPacket) is still wrong (return value description).

Best,
Daniel

the__j

Hey,
the code seems to be fix now ( 0 = ok ), the return description in the text is not correct.
would be nice to see consistent return values in a lib. SigFox.begin returns 1 = ok.

thanks. 

Go Up