You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
823 B

  1. /**
  2. * @file TinyGsmTemperature.tpp
  3. * @author Volodymyr Shymanskyy
  4. * @license LGPL-3.0
  5. * @copyright Copyright (c) 2016 Volodymyr Shymanskyy
  6. * @date Nov 2016
  7. */
  8. #ifndef SRC_TINYGSMTEMPERATURE_H_
  9. #define SRC_TINYGSMTEMPERATURE_H_
  10. #include "TinyGsmCommon.h"
  11. #define TINY_GSM_MODEM_HAS_TEMPERATURE
  12. template <class modemType>
  13. class TinyGsmTemperature {
  14. public:
  15. /*
  16. * Temperature functions
  17. */
  18. float getTemperature() {
  19. return thisModem().getTemperatureImpl();
  20. }
  21. /*
  22. * CRTP Helper
  23. */
  24. protected:
  25. inline const modemType& thisModem() const {
  26. return static_cast<const modemType&>(*this);
  27. }
  28. inline modemType& thisModem() {
  29. return static_cast<modemType&>(*this);
  30. }
  31. float getTemperatureImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED;
  32. };
  33. #endif // SRC_TINYGSMTEMPERATURE_H_