You are viewing an older revision! See the latest version

NetServicesTribute

This documentation is for the NetServices tribute library.

This library is based on Donatien's source V1.04 (5 August 2010).

The following changes are made:

#pragma diag_remark directives are added to the following files to suppress compiler warnings

  • EthernetNetIf.cpp
  • lwipNetUdpSocket.cpp
  • igmp.c
  • mem.c
  • RPCHandler.cpp
  • MySQLClient.cpp
  • NTPClient.cpp

EthernetNetIf.cpp / .h

  • turn off debug (uncomment line 34 in .cpp if required), IP address can be printed instead using getIp() method

printf("Connected ok, IP : %d.%d.%d.%d\n", eth.getIp()[0], eth.getIp()[1], eth.getIp()[2], eth.getIp()[3]);
  • optional hostname in DHCP constructor

// set hostname ready for DHCP
EthernetNetIf eth("mbedSE");

Import library

Public Member Functions

EthernetNetIf (const char *hostname=NULL)
Instantiates the Interface and register it against the stack, DHCP will be used.
EthernetNetIf ( IpAddr ip, IpAddr netmask, IpAddr gateway, IpAddr dns)
Instantiates the Interface and register it against the stack, DHCP will not be used.
EthernetErr setup (int timeout_ms=15000)
Brings the interface up.
const char * getHwAddr () const
Returns an array containing the hardware address.
const char * getHostname () const
Returns a pointer to the hostname set in the constructor.
IpAddr getIp () const
Returns the IP of the interface once it's connected.

mem.c

  • added MEM_POSITION to ram_heap

memp.c

  • added MEM_POSITION to memp
  • added MEM_POSITION to memp_bases
  • added MEM_POSITION to memp_memory

lwipopts.h

  • turned off SIO_FIFO_DEBUG and TCPDUMP_DEBUG
  • defined LWIP_NETIF_HOSTNAME in DHCP options section

Warning

MEM_POSITION becomes effective (due to mem.c and memp.c changes) and is defined as AHBSRAM1 (not AHBSRAM0)

lwipopts2.h

  • deleted (not used)

netCfg.h

  • disabled all options apart from NET_ETH and NET_LWIP_STACK

All wikipages