Udp socket sample program. This program will send back the received packet.
Dependencies: mbed NyFileSystems mbed-rtos libMiMic
Diff: main.cpp
- Revision:
- 30:2be65b31e086
- Parent:
- 29:821fd574d883
--- a/main.cpp Wed Oct 23 05:09:04 2013 +0000 +++ b/main.cpp Tue Sep 15 11:44:26 2015 +0000 @@ -14,7 +14,6 @@ NetConfig cfg; //create network configulation -Net* net; DigitalOut led1(LED1); DigitalOut led2(LED2); @@ -24,7 +23,8 @@ int main() { - net=new Net();//Net constructor must be created after started RTOS + MiMicNetIf netif; + Net* net=new Net(netif);//Net constructor must be created after started RTOS // manual setting cfg.setIpAddr(192,168,128,39); @@ -62,7 +62,7 @@ continue; } led3=1; - if(!socket.sendTo(peer_host,port,rx,l)){ + if(!socket.sendTo(peer_host,port,(const char*)rx,l)){ //Error led2=0; led3=0;