Skip to content

Non blocking miThermometer.getData() #3

@Art-ut-Kia

Description

@Art-ut-Kia

Hi, very happy to have found this library. I'd like to integrate several Mijia temp sensors in a home monitoring system.

Is your feature request related to a problem? Please describe.
The example (ESP32_ATC_MiThermometer_Client.ino) works well. However the miThermometer.getData() is blocking.
It's not a good news to have the ESP32 blocked for 5 seconds and not reacting to the user inputs

Describe the solution you'd like
A callback mechanism, integrated in the ATC_MiThermometer class, that would manage the sensor callbacks

  • semaphores to know whether new data is available or not

Describe alternatives you've considered
Make use of FreeRtos to launch getData in a seperate task. But I'm not sure it's compatible with NimBLEDevice.h/.cpp

Additional context
Ideally my system would include a touchscreen and implement a thermostat feature.
Blocking that for 5s is not acceptable

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions