IBM IoT Client Ethernet example

Dependencies:   C12832_fix EthernetInterface LM75B MMA7660 MQTT mbed-rtos mbed

Fork of IBMIoTClientEthernetExample by IBM Watson IoT

Files at this revision

API Documentation at this revision

Comitter:
MACRUM
Date:
Sun Mar 22 03:12:30 2015 +0000
Parent:
13:2234cf0a8127
Commit message:
Fix mac address handling issue for Arch Pro and GR-PEACH

Changed in this revision

LPC1768.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 2234cf0a8127 -r 1dd53a6d02d2 LPC1768.h
--- a/LPC1768.h	Fri Mar 20 16:03:58 2015 +0000
+++ b/LPC1768.h	Sun Mar 22 03:12:30 2015 +0000
@@ -18,7 +18,8 @@
 #if !defined(LPC1768_H)
 #define LPC1768_H
 
-#if 1 // Arch Pro
+#if defined(TARGET_ARCH_PRO) // Seeed Studio Arch Pro
+
 C12832 lcd(D11, D13, D12, D7, D10);
 DigitalOut led2(LED2);
 PwmOut r(D5);
@@ -33,7 +34,12 @@
 DigitalIn Right(A5);
 AnalogIn ain1(A0);
 AnalogIn ain2(A1);
+
+#define LED2_OFF 1
+#define LED2_ON 0
+
 #else
+
 C12832 lcd(p5, p7, p6, p8, p11);
 DigitalOut led2(LED2);
 PwmOut r(p23);
@@ -48,11 +54,13 @@
 DigitalIn Right(p16);
 AnalogIn ain1(p19);
 AnalogIn ain2(p20);
-#endif
 
 #define LED2_OFF 0
 #define LED2_ON 1
 
+#endif
+
+
 #define DEFAULT_TYPE_NAME "iotsample-mbed-lpc1768"
 
 #include "lpc_phy.h"
diff -r 2234cf0a8127 -r 1dd53a6d02d2 main.cpp
--- a/main.cpp	Fri Mar 20 16:03:58 2015 +0000
+++ b/main.cpp	Sun Mar 22 03:12:30 2015 +0000
@@ -21,6 +21,11 @@
  *
  *******************************************************************************/
 
+#if defined(TARGET_LPC1768)
+// Comment out folloing line when you are not using Seeed Studio Arch Pro
+#define TARGET_ARCH_PRO
+#endif
+
 #include "LM75B.h"
 #include "MMA7660.h"
 #include "MQTTClient.h"
@@ -44,12 +49,13 @@
 
 #define MQTT_MAX_PACKET_SIZE 250
 
-#if defined(TARGET_ARCH_PRO)
-#warning "Compiling for mbed ARCH PRO"
-#include "RZA1H.h"
-#elif defined(TARGET_LPC1768)
-#warning "Compiling for mbed LPC1768"
-#include "LPC1768.h"
+#if defined(TARGET_LPC1768)
+  #if defined(TARGET_ARCH_PRO)
+    #warning "Compiling for mbed Arch Pro"
+  #else
+    #warning "Compiling for mbed LPC1768"
+  #endif
+  #include "LPC1768.h"
 #elif defined(TARGET_K64F)
 #warning "Compiling for mbed K64F"
 #include "K64F.h"
@@ -421,3 +427,15 @@
         client.yield(10);  // allow the MQTT client to receive messages
     }
 }
+
+#if defined(TARGET_ARCH_PRO) | defined(TARGET_RZ_A1H)
+extern "C" void mbed_mac_address(char *mac)
+{
+    mac[0] = 0x00;
+    mac[1] = 0x02;
+    mac[2] = 0xF7;
+    mac[3] = 0xF1;
+    mac[4] = 0x91;
+    mac[5] = 0x9F;
+};
+#endif