Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: WIFI_API_32kRAM mbed
Fork of NNN40_WiFi by
Diff: main.cpp
- Revision:
- 13:6570897e31f8
- Parent:
- 7:c497e792660d
- Child:
- 14:1f8b31c4dcc1
diff -r eefd6b59fd16 -r 6570897e31f8 main.cpp
--- a/main.cpp Fri Aug 14 10:35:07 2015 +0000
+++ b/main.cpp Sat Aug 29 13:22:33 2015 +0000
@@ -1,14 +1,48 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
#include "mbed.h"
#include "WIFIDevice.h"
#include "EthernetInterface.h"
-
+
WIFIDevice wifi;
-
+
const char* PC_SERVER_ADDRESS = "192.168.1.234";
uint16_t PC_PORT = 5222;
DigitalOut LED01(LED1);
DigitalOut LED02(LED2);
-
+
int main(void)
{
EthernetInterface eth;
@@ -19,14 +53,14 @@
wait(1);
LED01 = 1;
eth.connect(40000);
-
+
LED02 = 1;
TCPSocketConnection socket;
socket.connect(PC_SERVER_ADDRESS,PC_PORT);
char msg[] = "Hello World";
socket.send(msg, sizeof(msg));
-
+
socket.close();
eth.disconnect();
wifi.sleep();
-}
+}
\ No newline at end of file
