Help edit on library ESP8266-Telnet-Client

Please help me edit the library ESP8266-Telnet-Client download link GitHub - videojedi/ESP8266-Telnet-Client: Telnet client for ESP8266. login details and multiple wifi ssids

On file ESP8266TelnetClient.cpp on line 267;
i want to replace Serial.print(c); to SoftwareSerial ...
but how to declare it in the constructor ?

ESP8266telnetClient::ESP8266telnetClient(WiFiClient& client){
this->client = &client;
}

Serial and SoftwareSerial both extend from Stream
so pass a Stream&

ESP8266telnetClient::ESP8266telnetClient(WiFiClient& client){
  this->client = &client;	
  this->outPtr = &_out;  // save the ptr to Stream
}

and change

void ESP8266telnetClient::print(char c){
	Serial.print(c);
}

to

void ESP8266telnetClient::print(char c){
	outPtr->print(c);
}

In the .h file
add Stream* outPtr;

private:
	WiFiClient* client;
        Stream *outPtr;

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.