Demo for Mbed Connect Cloud board and an MQTT Python Broker/Client
Fork of MQTT-Python-Demo by
Revision 0:a1a7aa0c3c53, committed 2017-11-14
- Comitter:
- Jenny Plunkett
- Date:
- Tue Nov 14 15:14:58 2017 -0600
- Child:
- 1:bc10688f7226
- Commit message:
- Initial blank program for tutorial
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832.lib Tue Nov 14 15:14:58 2017 -0600 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/chris/code/C12832/#7de323fa46fe
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MQTT.lib Tue Nov 14 15:14:58 2017 -0600 @@ -0,0 +1,1 @@ +https://mbed.org/teams/mqtt/code/MQTT/#9cff7b6bbd01
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Nov 14 15:14:58 2017 -0600
@@ -0,0 +1,32 @@
+//----------------------------------------------------------------------------
+// The confidential and proprietary information contained in this file may
+// only be used by a person authorised under and to the extent permitted
+// by a subsisting licensing agreement from ARM Limited or its affiliates.
+//
+// (C) COPYRIGHT 2016 ARM Limited or its affiliates.
+// ALL RIGHTS RESERVED
+//
+// This entire notice must be reproduced on all copies of this file
+// and copies of this file may only be made by a person if such person is
+// permitted to do so under the terms of a subsisting license agreement
+// from ARM Limited or its affiliates.
+//----------------------------------------------------------------------------
+#include "mbed.h"
+#include "C12832.h"
+#include "OdinWiFiInterface.h"
+#include "MQTTNetwork.h"
+#include "MQTTmbed.h"
+#include "MQTTClient.h"
+
+// GLOBAL VARIABLES HERE
+
+
+// FUNCTION DEFINTIONS HERE
+
+
+int main() {
+
+ // MAIN CODE HERE
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Tue Nov 14 15:14:58 2017 -0600 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#78474a5129e18e136cc7e872adbaa5b74fbb8f6a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed_settings.py Tue Nov 14 15:14:58 2017 -0600 @@ -0,0 +1,45 @@ +""" +mbed SDK +Copyright (c) 2016 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. +""" + +from os.path import join, abspath, dirname + +#ROOT = abspath(join(dirname(__file__), ".")) + +############################################################################## +# Build System Settings +############################################################################## +#BUILD_DIR = abspath(join(ROOT, "build")) + +# ARM +#ARM_PATH = "C:/Program Files/ARM" + +# GCC ARM +#GCC_ARM_PATH = "" + +# GCC CodeRed +#GCC_CR_PATH = "C:/code_red/RedSuite_4.2.0_349/redsuite/Tools/bin" + +# IAR +#IAR_PATH = "C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.0/arm" + +# Goanna static analyser. Please overload it in private_settings.py +#GOANNA_PATH = "c:/Program Files (x86)/RedLizards/Goanna Central 3.2.3/bin" + +#BUILD_OPTIONS = [] + +# mbed.org username +#MBED_ORG_USER = ""
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/working/main_working.h Tue Nov 14 15:14:58 2017 -0600
@@ -0,0 +1,54 @@
+//----------------------------------------------------------------------------
+// The confidential and proprietary information contained in this file may
+// only be used by a person authorised under and to the extent permitted
+// by a subsisting licensing agreement from ARM Limited or its affiliates.
+//
+// (C) COPYRIGHT 2016 ARM Limited or its affiliates.
+// ALL RIGHTS RESERVED
+//
+// This entire notice must be reproduced on all copies of this file
+// and copies of this file may only be made by a person if such person is
+// permitted to do so under the terms of a subsisting license agreement
+// from ARM Limited or its affiliates.
+//----------------------------------------------------------------------------
+#include "mbed.h"
+#include "C12832.h"
+#include "OdinWiFiInterface.h"
+#include "MQTTNetwork.h"
+#include "MQTTmbed.h"
+#include "MQTTClient.h"
+
+// GLOBAL VARIABLES HERE
+
+C12832 lcd(PE_14, PE_12, PD_12, PD_11, PE_9);
+OdinWiFiInterface wifi;
+
+// FUNCTION DEFINTIONS HERE
+
+void lcd_print(const char* message) {
+ lcd.cls();
+ lcd.locate(0, 3);
+ lcd.printf(message);
+}
+
+int main() {
+
+ // MAIN CODE HERE
+
+ lcd_print("Connecting...");
+ int ret = wifi.connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2);
+ if (ret != 0) {
+ lcd_print("Connection error.");
+ return -1;
+ }
+ lcd_print("Successfully connected!");
+
+ while (true) {
+
+ // WHILE LOOP CODE HERE
+
+
+
+ }
+
+}
Jenny Plunkett
