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.

49 lines
1.0 KiB

  1. /**
  2. * @file TinyGsmWifi.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_TINYGSMWIFI_H_
  9. #define SRC_TINYGSMWIFI_H_
  10. #include "TinyGsmCommon.h"
  11. #define TINY_GSM_MODEM_HAS_WIFI
  12. template <class modemType>
  13. class TinyGsmWifi {
  14. public:
  15. /*
  16. * WiFi functions
  17. */
  18. bool networkConnect(const char* ssid, const char* pwd) {
  19. return thisModem().networkConnectImpl(ssid, pwd);
  20. }
  21. bool networkDisconnect() {
  22. return thisModem().networkDisconnectImpl();
  23. }
  24. /*
  25. * CRTP Helper
  26. */
  27. protected:
  28. inline const modemType& thisModem() const {
  29. return static_cast<const modemType&>(*this);
  30. }
  31. inline modemType& thisModem() {
  32. return static_cast<modemType&>(*this);
  33. }
  34. /*
  35. * WiFi functions
  36. */
  37. bool networkConnectImpl(const char* ssid,
  38. const char* pwd) TINY_GSM_ATTR_NOT_IMPLEMENTED;
  39. bool networkDisconnectImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED;
  40. };
  41. #endif // SRC_TINYGSMWIFI_H_