5 years ago.

Could not run Example 12.3 on Ethernet IP address request from Textbook

I tried to run the example below from Toulson and Wilmhurst's Fast and Effective...., 2nd edition, slightly modified, but received error messages, see attached file. (The message didn't print completely on the terminal.) Please let me know what's wrong if possible. Thanks!

Program example 12.3 from Fast and Effective... text, 2nd ed.

  1. include "mbed.h"
  1. include "EthernetInterface.h" Must import this library first!

EthernetInterface eth;

Serial pc(USBTX, USBRX);

int main() {

pc.printf("Hello\n");

pc.printf("About to call eth.init()\n");

eth.init();

eth.connect();

pc.printf("IP address is %s\n", eth.getIPAddress());

eth.disconnect();

}

Which target and version of the Mbed library are you using Mbed-os or Mbed(os2) with Mbed-RTOS? and can you post your code here using ;

<<code title=>> your code here <</code>>

See editing tips.

I use EthernetInterface without any problems with both libraries.

posted by Paul Staron 20 Apr 2019
Be the first to answer this question.