Demo application for using the AT&T IoT Starter Kit Powered by AWS.

Dependencies:   SDFileSystem

Fork of ATT_AWS_IoT_demo by Anthony Phillips

IoT Starter Kit Powered by AWS Demo

This program demonstrates the AT&T IoT Starter Kit sending data directly into AWS IoT. It's explained and used in the Getting Started with the IoT Starter Kit Powered by AWS on starterkit.att.com.

What's required

  • AT&T IoT LTE Add-on (also known as the Cellular Shield)
  • NXP K64F - for programming
  • microSD card - used to store your AWS security credentials
  • AWS account
  • Python, locally installed

If you don't already have an IoT Starter Kit, you can purchase a kit here. The IoT Starter Kit Powered by AWS includes the LTE cellular shield, K64F, and a microSD card.

Committer:
ampembeng
Date:
Thu Dec 01 18:05:38 2016 +0000
Revision:
15:6f2798e45099
Child:
23:b9ff83dc965f
Initial commit.  Demo works with both the FRDM wired Ethernet and the Avnet Shield wireless modem.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ampembeng 15:6f2798e45099 1 /*******************************************************************************
ampembeng 15:6f2798e45099 2 * Copyright (c) 2014 IBM Corp.
ampembeng 15:6f2798e45099 3 *
ampembeng 15:6f2798e45099 4 * All rights reserved. This program and the accompanying materials
ampembeng 15:6f2798e45099 5 * are made available under the terms of the Eclipse Public License v1.0
ampembeng 15:6f2798e45099 6 * and Eclipse Distribution License v1.0 which accompany this distribution.
ampembeng 15:6f2798e45099 7 *
ampembeng 15:6f2798e45099 8 * The Eclipse Public License is available at
ampembeng 15:6f2798e45099 9 * http://www.eclipse.org/legal/epl-v10.html
ampembeng 15:6f2798e45099 10 * and the Eclipse Distribution License is available at
ampembeng 15:6f2798e45099 11 * http://www.eclipse.org/org/documents/edl-v10.php.
ampembeng 15:6f2798e45099 12 *
ampembeng 15:6f2798e45099 13 * Contributors:
ampembeng 15:6f2798e45099 14 * Allan Stockdill-Mander - initial API and implementation and/or initial documentation
ampembeng 15:6f2798e45099 15 *******************************************************************************/
ampembeng 15:6f2798e45099 16
ampembeng 15:6f2798e45099 17 /**
ampembeng 15:6f2798e45099 18 * @file timer_interface.h
ampembeng 15:6f2798e45099 19 * @brief Timer interface definition for MQTT client.
ampembeng 15:6f2798e45099 20 *
ampembeng 15:6f2798e45099 21 * Defines an interface to timers that can be used by other system
ampembeng 15:6f2798e45099 22 * components. MQTT client requires timers to handle timeouts and
ampembeng 15:6f2798e45099 23 * MQTT keep alive.
ampembeng 15:6f2798e45099 24 * Starting point for porting the SDK to the timer hardware layer of a new platform.
ampembeng 15:6f2798e45099 25 */
ampembeng 15:6f2798e45099 26
ampembeng 15:6f2798e45099 27 #ifndef __TIMER_INTERFACE_H_
ampembeng 15:6f2798e45099 28 #define __TIMER_INTERFACE_H_
ampembeng 15:6f2798e45099 29
ampembeng 15:6f2798e45099 30 #ifdef __cplusplus
ampembeng 15:6f2798e45099 31 extern "C" {
ampembeng 15:6f2798e45099 32 #endif
ampembeng 15:6f2798e45099 33
ampembeng 15:6f2798e45099 34 /**
ampembeng 15:6f2798e45099 35 * The platform specific timer header that defines the Timer struct
ampembeng 15:6f2798e45099 36 */
ampembeng 15:6f2798e45099 37 #include "timer_platform.h"
ampembeng 15:6f2798e45099 38
ampembeng 15:6f2798e45099 39 #include <stdint.h>
ampembeng 15:6f2798e45099 40 #include <stdbool.h>
ampembeng 15:6f2798e45099 41
ampembeng 15:6f2798e45099 42 /**
ampembeng 15:6f2798e45099 43 * @brief Timer Type
ampembeng 15:6f2798e45099 44 *
ampembeng 15:6f2798e45099 45 * Forward declaration of a timer struct. The definition of this struct is
ampembeng 15:6f2798e45099 46 * platform dependent. When porting to a new platform add this definition
ampembeng 15:6f2798e45099 47 * in "timer_<platform>.h" and include that file above.
ampembeng 15:6f2798e45099 48 *
ampembeng 15:6f2798e45099 49 */
ampembeng 15:6f2798e45099 50 //typedef mbed::Timer Timer;
ampembeng 15:6f2798e45099 51 typedef TimerExt Timer;
ampembeng 15:6f2798e45099 52
ampembeng 15:6f2798e45099 53 char expired(Timer* timer);
ampembeng 15:6f2798e45099 54 void countdown(Timer* timer, unsigned int timeout);
ampembeng 15:6f2798e45099 55 void InitTimer(Timer* timer);
ampembeng 15:6f2798e45099 56
ampembeng 15:6f2798e45099 57 /**
ampembeng 15:6f2798e45099 58 * @brief Check if a timer is expired
ampembeng 15:6f2798e45099 59 *
ampembeng 15:6f2798e45099 60 * Call this function passing in a timer to check if that timer has expired.
ampembeng 15:6f2798e45099 61 *
ampembeng 15:6f2798e45099 62 * @param Timer - pointer to the timer to be checked for expiration
ampembeng 15:6f2798e45099 63 * @return bool - true = timer expired, false = timer not expired
ampembeng 15:6f2798e45099 64 */
ampembeng 15:6f2798e45099 65 bool has_timer_expired(Timer *);
ampembeng 15:6f2798e45099 66 //bool has_timer_expired(mbed::Timer object); //TODO: modified to mbed::timer
ampembeng 15:6f2798e45099 67
ampembeng 15:6f2798e45099 68 /**
ampembeng 15:6f2798e45099 69 * @brief Create a timer (milliseconds)
ampembeng 15:6f2798e45099 70 *
ampembeng 15:6f2798e45099 71 * Sets the timer to expire in a specified number of milliseconds.
ampembeng 15:6f2798e45099 72 *
ampembeng 15:6f2798e45099 73 * @param Timer - pointer to the timer to be set to expire in milliseconds
ampembeng 15:6f2798e45099 74 * @param uint32_t - set the timer to expire in this number of milliseconds
ampembeng 15:6f2798e45099 75 */
ampembeng 15:6f2798e45099 76 void countdown_ms(Timer *, uint32_t);
ampembeng 15:6f2798e45099 77 //void countdown_ms(mbed::Timer object, uint32_t);
ampembeng 15:6f2798e45099 78
ampembeng 15:6f2798e45099 79 /**
ampembeng 15:6f2798e45099 80 * @brief Create a timer (seconds)
ampembeng 15:6f2798e45099 81 *
ampembeng 15:6f2798e45099 82 * Sets the timer to expire in a specified number of seconds.
ampembeng 15:6f2798e45099 83 *
ampembeng 15:6f2798e45099 84 * @param Timer - pointer to the timer to be set to expire in seconds
ampembeng 15:6f2798e45099 85 * @param uint32_t - set the timer to expire in this number of seconds
ampembeng 15:6f2798e45099 86 */
ampembeng 15:6f2798e45099 87 void countdown_sec(Timer *, uint32_t);
ampembeng 15:6f2798e45099 88 //void countdown_sec(mbed::Timer object, uint32_t);
ampembeng 15:6f2798e45099 89
ampembeng 15:6f2798e45099 90 /**
ampembeng 15:6f2798e45099 91 * @brief Check the time remaining on a given timer
ampembeng 15:6f2798e45099 92 *
ampembeng 15:6f2798e45099 93 * Checks the input timer and returns the number of milliseconds remaining on the timer.
ampembeng 15:6f2798e45099 94 *
ampembeng 15:6f2798e45099 95 * @param Timer - pointer to the timer to be set to checked
ampembeng 15:6f2798e45099 96 * @return int - milliseconds left on the countdown timer
ampembeng 15:6f2798e45099 97 */
ampembeng 15:6f2798e45099 98 uint32_t left_ms(Timer *);
ampembeng 15:6f2798e45099 99 //uint32_t left_ms(mbed::Timer object);
ampembeng 15:6f2798e45099 100
ampembeng 15:6f2798e45099 101 /**
ampembeng 15:6f2798e45099 102 * @brief Initialize a timer
ampembeng 15:6f2798e45099 103 *
ampembeng 15:6f2798e45099 104 * Performs any initialization required to the timer passed in.
ampembeng 15:6f2798e45099 105 *
ampembeng 15:6f2798e45099 106 * @param Timer - pointer to the timer to be initialized
ampembeng 15:6f2798e45099 107 */
ampembeng 15:6f2798e45099 108 void init_timer(Timer *);
ampembeng 15:6f2798e45099 109 //void init_timer(mbed::Timer object);
ampembeng 15:6f2798e45099 110
ampembeng 15:6f2798e45099 111 #ifdef __cplusplus
ampembeng 15:6f2798e45099 112 }
ampembeng 15:6f2798e45099 113 #endif
ampembeng 15:6f2798e45099 114
ampembeng 15:6f2798e45099 115 #endif //__TIMER_INTERFACE_H_
ampembeng 15:6f2798e45099 116
ampembeng 15:6f2798e45099 117
ampembeng 15:6f2798e45099 118