Contains example code to connect the mbed LPC1768 or FRDM-K64F devices to the IBM Internet of Things Cloud service via ethernet.

Dependencies:   C12832 MQTT LM75B MMA7660

Dependents:   MFT_IoT_demo_USB400 IBM_RFID

Committer:
samdanbury
Date:
Wed Jul 16 12:03:54 2014 +0000
Revision:
0:cae064bcbe5e
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
samdanbury 0:cae064bcbe5e 1
samdanbury 0:cae064bcbe5e 2 #if !defined(MQTTETHERNET_H)
samdanbury 0:cae064bcbe5e 3 #define MQTTETHERNET_H
samdanbury 0:cae064bcbe5e 4
samdanbury 0:cae064bcbe5e 5 #include "MQTT_mbed.h"
samdanbury 0:cae064bcbe5e 6 #include "EthernetInterface.h"
samdanbury 0:cae064bcbe5e 7 #include "MQTTSocket.h"
samdanbury 0:cae064bcbe5e 8 #include <string>
samdanbury 0:cae064bcbe5e 9
samdanbury 0:cae064bcbe5e 10 class MQTTEthernetIoT : public MQTTSocket
samdanbury 0:cae064bcbe5e 11 {
samdanbury 0:cae064bcbe5e 12 public:
samdanbury 0:cae064bcbe5e 13 MQTTEthernetIoT()
samdanbury 0:cae064bcbe5e 14 {
samdanbury 0:cae064bcbe5e 15 eth.init(); // Use DHCP
samdanbury 0:cae064bcbe5e 16 eth.connect();
samdanbury 0:cae064bcbe5e 17 mac = eth.getMACAddress();
samdanbury 0:cae064bcbe5e 18 }
samdanbury 0:cae064bcbe5e 19
samdanbury 0:cae064bcbe5e 20 string getMACAddress() {
samdanbury 0:cae064bcbe5e 21 return mac;
samdanbury 0:cae064bcbe5e 22 }
samdanbury 0:cae064bcbe5e 23
samdanbury 0:cae064bcbe5e 24 private:
samdanbury 0:cae064bcbe5e 25
samdanbury 0:cae064bcbe5e 26 EthernetInterface eth;
samdanbury 0:cae064bcbe5e 27 string mac;
samdanbury 0:cae064bcbe5e 28
samdanbury 0:cae064bcbe5e 29 };
samdanbury 0:cae064bcbe5e 30
samdanbury 0:cae064bcbe5e 31
samdanbury 0:cae064bcbe5e 32 #endif