UDP通信のサンプルプログラム
Dependencies: EthernetInterface mbed-rtos mbed
Diff: main.cpp
- Revision:
- 1:617727625d66
- Parent:
- 0:e0ec056e8895
--- a/main.cpp Mon Apr 06 14:58:18 2015 +0000 +++ b/main.cpp Mon Apr 06 15:01:25 2015 +0000 @@ -1,4 +1,4 @@ -/*UDP通信サンプル +/*UDP通信サンプルコード 自分:mbedAから相手:mbedBへのデータ送信方法、相手:mbedBから自分:mbedAへのデータ受信方法*/ #include "mbed.h" #include "EthernetInterface.h" @@ -49,7 +49,7 @@ wait_ms(1); if(n_send < 0){ - pc.printf("Send unsuccessfully\n"); + pc.printf("Sent unsuccessfully\n"); return 0; } else pc.printf("Sent %d bytes Successfully!\n",n_send); @@ -58,11 +58,11 @@ wait_ms(1); if(n_receive < 0){ - pc.printf("Receive unsuccessfully\n"); + pc.printf("Received unsuccessfully\n"); return 0; } else { - pc.printf("Received %d byte Successfully! %s\n",n_receive); + pc.printf("Received %d byte Successfully!\n",n_receive); pc.printf("Received : %s\n",u_buff); } }