Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

private methods #24

Open
DocAlex opened this issue Nov 28, 2024 · 0 comments
Open

private methods #24

DocAlex opened this issue Nov 28, 2024 · 0 comments

Comments

@DocAlex
Copy link

DocAlex commented Nov 28, 2024

Hello,

thank you for sharing this code.

There is a small issue: You code is written very well if only this sensor is used alone. Within a system where multiple sensors and devices need to be handled waiting times for a sensor can lead to multiple problems.

In your interface you have only foreseen as public the methods: readHumidity and readTemperature.

If I want to

  1. trigger a measueremnt
  2. do something else
  3. retrieve data
    I would like to call the _readMeasurement(); method. Since this is declard as private I cannot do that even in a derived child class.

I would like to suggest to declare the _readMeasurement(); method as public or as protected. Then a child class could use this method.

Your interface is well prepared for this by using this->readHumidity(AHTXX_USE_READ_DATA);

Thank you again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant