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: EthernetInterface PololuLedStripx mbed-rtos mbed nanoservice_client_1_12_X
Fork of LPC1768_LWM2M_Client by
Revision 11:3e5ac016a106, committed 2014-10-04
- Comitter:
- michaeljkoster
- Date:
- Sat Oct 04 04:57:21 2014 +0000
- Parent:
- 10:5ecaf86d3936
- Child:
- 12:15829d1f9425
- Commit message:
- test lwm2m client for KL46Z
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ArchPro_LWM2M_LED_Client.lib Sat Oct 04 04:57:21 2014 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/MBED_DEMOS/code/ArchPro_LWM2M_LED_Client/#5ecaf86d3936
--- a/EthernetInterface.lib Tue Sep 30 03:31:19 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://developer.mbed.org/users/michaeljkoster/code/EthernetInterface/#6ca542f6c58d
--- a/IAP.lib Tue Sep 30 03:31:19 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://developer.mbed.org/users/sam_grove/code/IAP/#f794a51897b8
--- a/PololuLedStrip.lib Tue Sep 30 03:31:19 2014 +0000 +++ b/PololuLedStrip.lib Sat Oct 04 04:57:21 2014 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/michaeljkoster/code/PololuLedStripx/#77e743378104 +http://developer.mbed.org/users/michaeljkoster/code/PololuLedStripx/#b0d66298f49c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WiflyInterface.lib Sat Oct 04 04:57:21 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/teams/components/code/WiflyInterface/#fc3d86645d23
--- a/main.cpp Tue Sep 30 03:31:19 2014 +0000
+++ b/main.cpp Sat Oct 04 04:57:21 2014 +0000
@@ -1,12 +1,13 @@
#include "mbed.h"
-#include "EthernetInterface.h"
+#include "WiflyInterface.h"
#include "nsdl_support.h"
#include "dbg.h"
+
// Include resources
#include "light.h"
-#include "IAP.h"
#include "PololuLedStrip.h"
-PololuLedStrip ledStrip(P0_4);
+
+PololuLedStrip ledStrip(D2);
//#define LED_COUNT 60
#define LED_COUNT 120
rgb_color colors[LED_COUNT];
@@ -25,36 +26,13 @@
#define MASK "255.255.255.0"
#define GW "10.0.0.1"
-extern "C" void mbed_mac_address(char *mac)
-{
- static char buf[64] = {0};
- IAP iap;
- int32_t *block = iap.read_serial();
- uint32_t serial_number[5] = {0};
-
- memset(buf, 0, sizeof(buf));
- serial_number[0] = *(block);
- serial_number[1] = *(block+1);
- // we only want bottom 16 bits of word1 (MAC bits 32-47)
- // and bit 9 forced to 1, bit 8 forced to 0
- // Locally administered MAC, reduced conflicts
- // http://en.wikipedia.org/wiki/MAC_address
- //serial_number[0] |= 0x00000200;
- //serial_number[0] &= 0x0000FEFF;
- memcpy(mac, (uint8_t*) &serial_number[0], 6);
- mac[0] |= 0x02;
- mac[0] &= 0xFE;
- mac[5] |= 0x02;
- mac[5] &= 0xFE;
-
- // snprintf(buf, 16, "%4X%08X", serial_number[0], serial_number[1]);
-}
// NSP configuration
/* Change this IP address to that of your NanoService Platform installation */
//static const char* NSP_ADDRESS = "217.140.101.20"; /* public mbed demo server */
-static const char* NSP_ADDRESS = "23.99.99.252"; // barista.cloudapp.net
+static const char* NSP_ADDRESS = "54.228.25.31"; //leshan sandbox
+//static const char* NSP_ADDRESS = "23.99.99.252"; // barista.cloudapp.net
//static const char* NSP_ADDRESS = "192.168.1.200";
static const int NSP_PORT = 5683;
char endpoint_name[24] = "LED-booth-";
@@ -64,7 +42,9 @@
// ****************************************************************************
// Ethernet initialization
-EthernetInterface eth;
+//EthernetInterface eth;
+WiflyInterface eth(D1, D0, D5, LED1, "demo", "ARMDEMO1", WPA);
+
static void ethernet_init()
{
/* Initialize network */
@@ -76,7 +56,7 @@
eth.init(IP, MASK, GW);
NSDL_DEBUG("eth.init\r\n");
#endif
- if(eth.connect(30000) == 0)
+ if(eth.connect() == 0)
pc.printf("Connect OK\n\r");
NSDL_DEBUG("IP Address:%s ", eth.getIPAddress());
--- a/nsdl_support.cpp Tue Sep 30 03:31:19 2014 +0000 +++ b/nsdl_support.cpp Sat Oct 04 04:57:21 2014 +0000 @@ -4,7 +4,6 @@ #include "nsdl_support.h" #include "mbed.h" #include "rtos.h" -#include "EthernetInterface.h" #include "UDPSocket.h" #include "Endpoint.h"
