fix some thing

This commit is contained in:
2023-05-14 23:16:16 +02:00
parent 650290ab67
commit 7b21441976
6 changed files with 24 additions and 10 deletions

View File

@ -49,8 +49,6 @@ public:
*/
bool connect();
//TODO :: Check wifibegin avant
private:
@ -89,7 +87,11 @@ private:
*/
String token;
/**
* @brief wifi démmaré
*
*/
bool init;
};

View File

@ -8,11 +8,13 @@ API::API(String user, String password, String host, bool https){
this->https = https;
this->token = "";
this->client = new WiFiEspClient();
this->init = false;
}
bool API::wifiBegin(String wifiId, String wifiPass, Stream* espSerial){
WiFi.init(espSerial);
this->init = true;
// check for the presence of the shield
if (WiFi.status() == WL_NO_SHIELD) {
@ -28,6 +30,7 @@ bool API::wifiBegin(String wifiId, String wifiPass, Stream* espSerial){
return true;
}
bool API::connect(){
if(!this->init)return false;
this->client->stop();
bool sortie = false;