Skip to content

Commit

Permalink
Originating each outgoing network connection from a different source …
Browse files Browse the repository at this point in the history
…port (in the Client class of the Ethernet library).

Updating readme and todo.
  • Loading branch information
damellis committed Jan 7, 2009
1 parent 19c191e commit a4b52f2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
6 changes: 5 additions & 1 deletion hardware/libraries/Ethernet/Client.cpp
Expand Up @@ -8,6 +8,8 @@ extern "C" {
#include "Client.h"
#include "Server.h"

uint16_t Client::_srcport = 0;

Client::Client(uint8_t sock) {
_sock = sock;
}
Expand All @@ -29,8 +31,10 @@ uint8_t Client::connect() {
if (_sock == 255)
return 0;

_srcport++;

// XXX: what port should we connect from?
socket(_sock, Sn_MR_TCP, _port, 0);
socket(_sock, Sn_MR_TCP, _port, 1024 + _srcport);

if (!::connect(_sock, _ip, _port))
return 0;
Expand Down
1 change: 1 addition & 0 deletions hardware/libraries/Ethernet/Client.h
Expand Up @@ -5,6 +5,7 @@

class Client : public Print {
private:
static uint16_t _srcport;
uint8_t _sock;
uint8_t *_ip;
uint16_t _port;
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Expand Up @@ -65,7 +65,10 @@ UPDATES
any pulse that had already started when the function was called).
* Fixing bug in random() that limited the ranges of values generated. Thanks
to Mikal Hart.
* Modifying delay() to pause for at least the given number of milliseconds.
* Fixing bug in Ethernet library that interfered with use of pins 8 and 9.
* Originating each outgoing network connection from a different port (in the
Client class of the Ethernet library). Thanks to Paul and joquer.
* Modifying the core, libraries, and bootloader source to support the
ATmega328, but not yet including it in boards menu.
* Updating ATmega168 bootloader to work with standard distributions of avrdude
Expand Down
13 changes: 11 additions & 2 deletions todo.txt
@@ -1,13 +1,12 @@
0013 arduino

Fix TICR0 for ATmega8.
Fix delay() comparison to use <= not <.
Ethernet library should use a different source port for each outgoing Client connection: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1227978344
Support atmega328: http://spiffie.org/know/arduino_328/
- add atmega328 to avrdude.conf (on Windows)

AVR

Make Client::_srcport static? http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1227735530
Allow hardcoding of R/W line to ground with LiquidCrystal library.
Improve shiftOut() performance: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1216659239/0
Add String library.
Expand Down Expand Up @@ -123,6 +122,16 @@ Document Wire.endTransmission() return values: http://www.arduino.cc/cgi-bin/yab

DOCUMENTATION / EXAMPLES

Photos:
- Loop
- Analog Input (potentiometer and LDR on analog input 0)
Consistency:
- ledpin vs. ledPin
- value vs. val
Add a Brightness example where an analog input controls the analog output.
Graph example should use an intermediate variable.
Button example says pin 7 but uses pin 2.
Split Loop example in two (one that does loops, another that does arrays).
Add LiquidCrystal library examples.
Add Ethernet library examples.
Add Wire library examples.
Expand Down

0 comments on commit a4b52f2

Please sign in to comment.