yasheena/telnetspy

Issues when using platformIO

jbuszkie opened this issue · 3 comments

I just found this library and it suits my need. Thanks! I'm using platformio as my environment. It's really neat and way better than the arduino IDE. There are some issues with this library, however..

  1. There is no "max" defined.
void TelnetSpy::setMinBlockSize(uint16_t minSize) {
  minBlockSize = max(1, minSize);
}

So I had to include this in the code

#undef max
#define max(a,b) ((a)>(b)?(a):(b))

  1. There is no RingBuf.h
    You might want to update the readme to include something about which library is needed to be included. I used
    url=https://github.com/wizard97/ArduinoRingBuffer
    And it seems to work.

  2. in the example code and in the readme you have in the master branch you have:

This function installs a callback function which will be called on every telnet connect of this object (except rejected connect tries). Use NULL to remove the callback.
Default: NULL

void setCallbackOnConnect(void (*callback)());
and it's not there in the 1.1 tag. Maybe add something to the master branch readme to have it mention to use the 1.1 readme and example.

I have the same problem...
I am wondering, is this project still maintained ?

All of these problems are related to the fact that PlatformIO only has the latest tagged version of the code, namely v1.1, which is from Oct 23, 2017!!! max was resolved, no more external RingBuffer dependency, and documentation is correct for the version it relates to (Master branch is NOT v1.1!).

There are issues with the library post the last update to this library (related to changes from Sep 28, 2019 in the putc1 function in the ESP8266 Arduino core), which is why forks like strandaster/telnetspy exist. Best way to use these in PlatformIO now is to use the master branch as is, or tie it to a specific commit if you want to version lock it.

i.e. lib_deps = strandaster/telnetspy or lib_deps = strandaster/telnetspy#33b39d in your projects platformio.ini

With version 1.4 all problems should be gone.