anupam19 / webduino

Automatically exported from code.google.com/p/webduino
0 stars 0 forks source link

compatibility with arduino 1.0 #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. have a project working with webduino and arduino 0022 (all tested on a 
debian sid system)
2. upgrade to arduino 1.0
3. building fails:

./WebServer.h:203:16: error: conflicting return type specified for ‘virtual 
void WebServer::write(uint8_t)’
/usr/share/arduino/hardware/arduino/cores/arduino/Print.h:48:20: error:   
overriding ‘virtual size_t Print::write(uint8_t)’
./WebServer.h:205:16: error: conflicting return type specified for ‘virtual 
void WebServer::write(const uint8_t*, size_t)’

the signatures in Print.h were changed in arduino to return size_t while they 
returned void in 0022. i tried the "trivial" approach of changing some voids to 
size_t in webduino, but there seems to be a little more to it as i got problems 
with things being purely virtual when they shouldn't.

Original issue reported on code.google.com by chr...@fsfe.org on 19 Dec 2011 at 11:33

GoogleCodeExporter commented 9 years ago
I think they modified the Server class to be EthernetServer and Client to be 
EthernetClient.. as well as the Print class you suggested..
I made the modifications below, and at least got it to compile, I am waiting 
for my shield to arrive, so I cannot test

-Jimbo

Webserver.h (lines 203-206)
   virtual size_t write(uint8_t);
   virtual size_t write(const char *str);
  virtual size_t write(const uint8_t *buffer, size_t size);

Webserver.h (lines 208/209)
private:
  EthernetServer m_server;
  EthernetClient m_client;

Webserver.cpp (63-76 ish)
size_t WebServer::write(uint8_t ch)
{
  m_client.write(ch);
}

size_t WebServer::write(const char *str)
{
  m_client.write(str);
}

size_t WebServer::write(const uint8_t *buffer, size_t size)
{
  m_client.write(buffer, size);
}

Original comment by jbanas...@gmail.com on 21 Dec 2011 at 7:54

GoogleCodeExporter commented 9 years ago
Oops, forget to mention I have added Ethernet.h to the Webserver.h, it's 2 AM, 
what'dya expect?

#include <Client.h>
#include <Server.h>
#include <Ethernet.h>

Original comment by jbanas...@gmail.com on 21 Dec 2011 at 7:57

GoogleCodeExporter commented 9 years ago
http://arduino.cc/forum/index.php/topic,82450.msg633489.html#msg633489

I've tested this with the Arduino Uno R3 with the Arduino Ethernet Shield, and 
it works.  

Original comment by seth.kaz...@gmail.com on 8 Jan 2012 at 2:35

GoogleCodeExporter commented 9 years ago
Current code on GitHub works with 1.0.

Original comment by ben.combee on 9 Jan 2012 at 4:11