Go Down

Topic: Ethernet UDP hang (Read 11 times) previous topic - next topic

DylanHall

The following might be helpful:

http://arduino.cc/playground/Main/Printf

There's stuff in there about getting printf to write directly to the serial port, no need for buffers (sprintf).  There are also notes on storing your strings in flash (like F() with the regular Serial.print functions).

Hope that helps,

Dylan


Viald

Thank you. Very interesting, again I'm able to optimize a bit more my code  ;)

Lugination

I'm trying to webserver programs, and i got many errors. something wrong with my udp? please help me to solve this.

Code: [Select]
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:35: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: In function 'void begin(uint16_t)':
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:36: error: '_port' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:37: error: '_sock' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: At global scope:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:44: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: In function 'uint16_t sendPacket(uint8_t*, uint16_t, uint8_t*, uint16_t)':
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:45: error: '_sock' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: At global scope:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:50: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: In function 'uint16_t sendPacket(const char*, uint8_t*, uint16_t)':
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:56: error: '_sock' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: At global scope:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:60: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: In function 'int available()':
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:61: error: '_sock' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: At global scope:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:69: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: In function 'int readPacket(uint8_t*, uint16_t, uint8_t*, uint16_t*)':
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:70: error: '_sock' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: At global scope:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:74: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: In function 'int readPacket(uint8_t*, uint16_t)':
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:77: error: '_sock' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: At global scope:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:80: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:88: error: 'UdpClass' does not name a type

SurferTim

@Lugination: Looks like you did not add the include files required to compile the sketch. UDP requires these includes.
Code: [Select]
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>


Go Up