I want to create my own function in an existing library from Arduino/ESP8266, pass an empty array in case the user doesn't have any header.
//.h file
t_httpUpdate_return updateheader(WiFiClient& client, const String& url, const String& currentVersion = "", const String& header[][2] = {{}});
//.cpp file
HTTPUpdateResult ESP8266HTTPUpdate::updateheader(WiFiClient& client, const String& url, const String& currentVersion, const String& header[][2])
{
HTTPClient http;
http.begin(client,url);
for (int i, i < sizeof(header), i++){
http.addHeader(F(header[i][0]), header[i][1]);
}
return handleUpdate(http, currentVersion, false);
}
But I get the next error when I try to compiling:
C:\Users\myuser\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266httpUpdate\src/ESP8266httpUpdate.h:125:143: error: declaration of 'header' as array of references
t_httpUpdate_return updateheader(WiFiClient& client, const String& url, const String& currentVersion = "", const String& header[][2] = {{}});
^
exit status 1
Error compilando para la tarjeta NodeMCU 1.0 (ESP-12E Module).
I'm using ESP8266httpUpdate Library.