INSAT_MiniPRoject

Dependencies:   MQTT NDefLib NetworkSocketAPI Servo Light_Sensor_Nucleo X_NUCLEO_IDW01M1v2 mbed

Fork of IDW01M1_Cloud_IBM by ST

Revision:
10:c7b62ce013ad
Parent:
8:6df01cb43137
Child:
11:70df7089e2da
--- a/main.cpp	Sat May 14 11:54:31 2016 +0530
+++ b/main.cpp	Sat May 14 12:10:37 2016 +0530
@@ -1,3 +1,19 @@
+/* SpwfInterface NetworkSocketAPI Example Program
+ * Copyright (c) 2015 ARM Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #include "mbed.h"
 #include "SPWFInterface.h"
 #include "TCPSocket.h"
@@ -37,7 +53,7 @@
     SocketAddress addr(&spwf, "st.com");
     printf("\r\nst.com resolved to: %s\r\n", addr.get_ip_address());
 
-    pc.printf("\r\nconnecting to http://time-d.nist.gov\r\n");   //time-d.nist.gov
+    pc.printf("\r\nconnecting to http://time-d.nist.gov\r\n");
     
     TCPSocket socket(&spwf);
     err = socket.connect("time-d.nist.gov", 37);
@@ -46,7 +62,7 @@
       pc.printf("\r\nCould not connect to Socket, err = %d!!\r\n", err); 
       return -1;
     }
-    char buffer[64];
+    char buffer[10];
     int count = 0;
     pc.printf("\r\nReceiving Data\r\n"); 
     count = socket.recv(buffer, sizeof buffer);