aREST
aREST copied to clipboard
rest.handle(client) not matched when using Ethernet2 library
Hello,
First of all: thanks for the great work, I hope you're still working on this and if so, I've found a little bug for you.
I'm using the Arduino Uno with the latest Ethernet Shield, which requires the Ethernet2 and EthernetUdp2 library (instead of the Ethernet and the EthernetUdp libraries).
I made a very basic setup to check if everything is working properly:
//#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
//#include <EthernetUdp.h>
#include <aREST.h>
#include <Ethernet2.h>
#include <EthernetUdp2.h>
#include <SPI.h>
byte mac[] = { }; //MAC is inserted here
IPAddress ip(); //ip is here
EthernetServer server(80);
aREST rest = aREST();
void setup() {
Serial.begin(9600);
Ethernet.begin(mac, ip);
server.begin();
}
void loop() {
EthernetClient client = server.available();
rest.handle(client);
}
When putting this in your sketch you'll receive an error:
36: error: no matching function for call to 'aREST::handle(EthernetClient&)' rest.handle(client);
Now, when you uncomment the Ethernet and EthernetUdp includes and instead comment out the "2 " libraries, you'll notice that it will compile. Is this a bug, or am I missing something?
Though the change log in Version 2.8.0 suggest that the issue was solved in version 2.7.4, I’m still getting the “no matching function for call to 'aREST::handle(EthernetClient&)'“ error. The Ethernet2 library is essential for me since the latest ethernet lib eats up too much memory such that the program can’t fit onto an UNO anymore. Any guidance to resolve this issue available?