sandbox / Mbed OS simple-mbed-client-example

Dependencies:   simple-mbed-client

Fork of simple-mbed-client-example by Jan Jongboom

Revision:
23:16f397924e3d
Parent:
17:6d69aa1b393f
Child:
28:f5e41738699d
--- a/main.cpp	Mon Aug 15 12:06:37 2016 +0200
+++ b/main.cpp	Tue Aug 23 16:02:01 2016 +0200
@@ -6,9 +6,9 @@
 Serial pc(USBTX, USBRX);
 SimpleMbedClient client;
 
-DigitalOut led(LED_RED);
-DigitalOut blinkLed(LED_GREEN);
-InterruptIn btn(SW3);
+DigitalOut led(LED1);
+DigitalOut blinkLed(LED2);
+InterruptIn btn(PTA1);
 Semaphore updates(0);
 
 void patternUpdated(string v) {
@@ -52,12 +52,14 @@
 
     client.define_function("led/0/play", &play);
 
-    NetworkInterface* network = easy_connect();
+    NetworkInterface* network = easy_connect(true);
     if (!network) {
         return 1;
     }
 
-    bool setup = client.setup(network);
+    struct MbedClientOptions opts = client.get_default_options();
+    opts.ServerAddress = MBED_SERVER_ADDRESS;
+    bool setup = client.setup(opts, network);
     if (!setup) {
         printf("Client setup failed\n");
         return 1;