ethernet

Dependencies:   EthernetInterface mbed-rtos mbed

Fork of TCPSocket_HelloWorld by mbed official

main.cpp

Committer:
MohamadNazrin
Date:
2018-02-09
Revision:
15:bc7fc13dc5f6
Parent:
11:59dcefdda506
Child:
16:65255e25e5dc

File content as of revision 15:bc7fc13dc5f6:

#include "mbed.h"
#include "EthernetInterface.h"
int main() {
    
static const char*          mbedIp       = "192.168.137.2";  //IP
static const char*          mbedMask     = "255.255.255.0";  // Mask
static const char*          mbedGateway  = "192.168.137.1";    //Gateway

    EthernetInterface eth;
 //   eth.init(); //Use DHCP
 eth.init(mbedIp,mbedMask,mbedGateway); 
    eth.connect();
    printf("IP Address is %s\n", eth.getIPAddress());

    while(1) {}
}