Page 1 of 1

is there a function in the Arduino C++-library that responds with true of notification i sREALLY send?

Posted: 2. Jan 2023, 20:23
by StefanL38
Hi everybody,

i'm developping code for my ESP32 running Arduino C++-code.

I have one device that is partially running on battery. To use as less battery-energy as possible I use a ESP32-board which consumes 15 µA in deepsleep-mode.
I recongnised if I execute code in this way

Code: Select all

      pushsafer.sendEvent(PushSaferData) ;
      esp_deep_sleep_start();
The notification is not sent

I added a delay(5000); to make it work

Code: Select all

      pushsafer.sendEvent(PushSaferData) ;
      delay(5000);
      esp_deep_sleep_start();
My question is:
is there any kind of function that reports "notification send" / "sending notification failed"
so I could code something like this

Code: Select all

      pushsafer.sendEvent(PushSaferData) ;
      while ( !pushsafer.sendEventFinished(3000) ) {
         yield(); // wait for finished "signal" has arrived either successfull or if unsuccessfull with a timeout of 3000 milliseconds
      }   
      esp_deep_sleep_start();
To minimise the power-on-time to the minimum
With power-on the ESP32 consumes 50 mA which is 3000 times more than in deepsleep-mode (0,015 mA)

best regards Stefan

Re: is there a function in the Arduino C++-library that responds with true of notification i sREALLY send?

Posted: 3. Jan 2023, 10:12
by admin
Hello,

pushsafer.sendEvent(input) returns the status of the transmitted notification.

Regards Kevin