Local copy

Dependencies:   C12832_lcd ConfigFile EthernetInterface LM75B MMA7660 MQTTPacket mbed-rtos mbed

Fork of IBMIoTClientExampleForLPC1768 by Sam Danbury

Committer:
samdanbury
Date:
Mon Jun 23 13:37:46 2014 +0000
Revision:
0:6276e9f72327
Child:
2:25ddff75a8c7
initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
samdanbury 0:6276e9f72327 1 /*******************************************************************************
samdanbury 0:6276e9f72327 2 * Copyright (c) 2014 IBM Corporation and other Contributors.
samdanbury 0:6276e9f72327 3 *
samdanbury 0:6276e9f72327 4 * All rights reserved. This program and the accompanying materials
samdanbury 0:6276e9f72327 5 * are made available under the terms of the Eclipse Public License v1.0
samdanbury 0:6276e9f72327 6 * which accompanies this distribution, and is available at
samdanbury 0:6276e9f72327 7 * http://www.eclipse.org/legal/epl-v10.html
samdanbury 0:6276e9f72327 8 *
samdanbury 0:6276e9f72327 9 * Contributors: Sam Danbury
samdanbury 0:6276e9f72327 10 * IBM - Initial Contribution
samdanbury 0:6276e9f72327 11 *******************************************************************************/
samdanbury 0:6276e9f72327 12
samdanbury 0:6276e9f72327 13 #include "MQTTPacket.h"
samdanbury 0:6276e9f72327 14 #include "rtos.h"
samdanbury 0:6276e9f72327 15 #include "EthernetInterface.h"
samdanbury 0:6276e9f72327 16 #include "C12832_lcd.h"
samdanbury 0:6276e9f72327 17
samdanbury 0:6276e9f72327 18 #include <iostream>
samdanbury 0:6276e9f72327 19 #include <string>
samdanbury 0:6276e9f72327 20 #include <vector>
samdanbury 0:6276e9f72327 21 #include <map>
samdanbury 0:6276e9f72327 22 #include <sstream>
samdanbury 0:6276e9f72327 23 #include <algorithm>
samdanbury 0:6276e9f72327 24
samdanbury 0:6276e9f72327 25 #define IBM_IOT_BROKER "m.qs.internetofthings.ibmcloud.com"
samdanbury 0:6276e9f72327 26 #define IBM_IOT_PORT 1883
samdanbury 0:6276e9f72327 27
samdanbury 0:6276e9f72327 28 using namespace std;
samdanbury 0:6276e9f72327 29
samdanbury 0:6276e9f72327 30 class QuickstartClient {
samdanbury 0:6276e9f72327 31 public:
samdanbury 0:6276e9f72327 32 bool connected;
samdanbury 0:6276e9f72327 33 C12832_LCD lcd;
samdanbury 0:6276e9f72327 34 TCPSocketConnection mysock;
samdanbury 0:6276e9f72327 35 string macAddress;
samdanbury 0:6276e9f72327 36 char topic[55];
samdanbury 0:6276e9f72327 37 int reconnectDelay(int attempt);
samdanbury 0:6276e9f72327 38
samdanbury 0:6276e9f72327 39 QuickstartClient(string mac);
samdanbury 0:6276e9f72327 40 void tryMqttConnect();
samdanbury 0:6276e9f72327 41 void connect();
samdanbury 0:6276e9f72327 42 void publish(string payload);
samdanbury 0:6276e9f72327 43 bool getConnection();
samdanbury 0:6276e9f72327 44 };