如何解决“没有匹配的函数调用'HTTPSRedirect :: printRedir(String&,const char *&)'”

时间:2019-04-30 22:18:23

标签: c nodemcu

我不确定您是否可以帮助我,但在http://embedded-lab.com/blog/post-data-google-sheets-using-esp8266/之后,我使用了下面的代码。

我已按照教程中的要求更新了HttpsRedirect库,但现在我得到了

  

/ home / abasel / Dropbox / Transfer / WorkingOn / WeatherStation-爸爸/WeatherStationBMP280-GSheets/WeatherStationBMP280-GSheets.ino:在函数'void postData(String,float)'中:   WeatherStationBMP280-GSheets:90:52:错误:没有匹配的函数可以调用'HTTPSRedirect :: printRedir(String&,const char *&,const char *&)'      client.printRedir(urlFinal,host,googleRedirHost);                                                       ^

     

/ home / abasel / Dropbox / Transfer / WorkingOn / WeatherStation-爸爸/WeatherStationBMP280-GSheets/WeatherStationBMP280-GSheets.ino:90:52:注意:候选人为:   从/ home / abasel / Dropbox / Transfer / WorkingOn / WeatherStation包含的文件中-爸爸/WeatherStationBMP280-GSheets/WeatherStationBMP280-GSheets.ino:9:0:   /home/abasel/Arduino/libraries/HTTPSRedirect/HTTPSRedirect.h:48:10:注意:bool HTTPSRedirect :: printRedir()        bool printRedir(void);
            ^

     

/home/abasel/Arduino/libraries/HTTPSRedirect/HTTPSRedirect.h:48:10:注意:候选人期望使用0个参数,提供3个   退出状态1   没有匹配的函数可以调用'HTTPSRedirect :: printRedir(String&,const char *&,const char *&)'

HTTPSRedirect库取自:https://github.com/electronicsguy/ESP8266/tree/master/HTTPSRedirect。我不确定如何更改下面的代码以适应更新的库。

这是发生此问题的电话

void postData(String tag, float value) {
  if (!client.connected()) {
    Serial.println("Connecting to client again…");
    client.connect(host, httpsPort);
  }
  String urlFinal = url + "tag = " + tag + "&value = " + String(value);
  client.printRedir(urlFinal, host, googleRedirHost);
}

我的声明如下:

const char* googleRedirHost = "script.googleusercontent.com";

const int httpsPort =     443;
HTTPSRedirect client(httpsPort);

// Prepare the url (without the varying data)
String url = String(" / macros / s / ") + GScriptId + " / exec ? ";```

0 个答案:

没有答案