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

/**
* @file TinyGsmWifi.tpp
* @author Volodymyr Shymanskyy
* @license LGPL-3.0
* @copyright Copyright (c) 2016 Volodymyr Shymanskyy
* @date Nov 2016
*/
#ifndef SRC_TINYGSMWIFI_H_
#define SRC_TINYGSMWIFI_H_
#include "TinyGsmCommon.h"
#define TINY_GSM_MODEM_HAS_WIFI
template <class modemType>
class TinyGsmWifi {
public:
/*
* WiFi functions
*/
bool networkConnect(const char* ssid, const char* pwd) {
return thisModem().networkConnectImpl(ssid, pwd);
}
bool networkDisconnect() {
return thisModem().networkDisconnectImpl();
}
/*
* CRTP Helper
*/
protected:
inline const modemType& thisModem() const {
return static_cast<const modemType&>(*this);
}
inline modemType& thisModem() {
return static_cast<modemType&>(*this);
}
/*
* WiFi functions
*/
bool networkConnectImpl(const char* ssid,
const char* pwd) TINY_GSM_ATTR_NOT_IMPLEMENTED;
bool networkDisconnectImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED;
};
#endif // SRC_TINYGSMWIFI_H_