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:
rfinn
Date:
Tue Feb 07 16:18:57 2017 +0000
Revision:
27:2f486c766854
Parent:
15:6f2798e45099
changed SDFileSystem library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ampembeng 15:6f2798e45099 1 /*
ampembeng 15:6f2798e45099 2 * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
ampembeng 15:6f2798e45099 3 *
ampembeng 15:6f2798e45099 4 * Licensed under the Apache License, Version 2.0 (the "License").
ampembeng 15:6f2798e45099 5 * You may not use this file except in compliance with the License.
ampembeng 15:6f2798e45099 6 * A copy of the License is located at
ampembeng 15:6f2798e45099 7 *
ampembeng 15:6f2798e45099 8 * http://aws.amazon.com/apache2.0
ampembeng 15:6f2798e45099 9 *
ampembeng 15:6f2798e45099 10 * or in the "license" file accompanying this file. This file is distributed
ampembeng 15:6f2798e45099 11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
ampembeng 15:6f2798e45099 12 * express or implied. See the License for the specific language governing
ampembeng 15:6f2798e45099 13 * permissions and limitations under the License.
ampembeng 15:6f2798e45099 14 */
ampembeng 15:6f2798e45099 15
ampembeng 15:6f2798e45099 16 /**
ampembeng 15:6f2798e45099 17 * @file aws_iot_log.h
ampembeng 15:6f2798e45099 18 * @brief Logging macros for the SDK.
ampembeng 15:6f2798e45099 19 * This file defines common logging macros with log levels to be used within the SDK.
ampembeng 15:6f2798e45099 20 * These macros can also be used in the IoT application code as a common way to output
ampembeng 15:6f2798e45099 21 * logs. The log levels can be tuned by modifying the makefile. Removing (commenting
ampembeng 15:6f2798e45099 22 * out) the IOT_* statement in the makefile disables that log level.
ampembeng 15:6f2798e45099 23 *
ampembeng 15:6f2798e45099 24 * It is expected that the macros below will be modified or replaced when porting to
ampembeng 15:6f2798e45099 25 * specific hardware platforms as printf may not be the desired behavior.
ampembeng 15:6f2798e45099 26 */
ampembeng 15:6f2798e45099 27
ampembeng 15:6f2798e45099 28 // Change to a number between 1 and 4 to debug the TLS connection
ampembeng 15:6f2798e45099 29 // WARNING: the large number of prints may cause timeouts during the connection.
ampembeng 15:6f2798e45099 30 #define DEBUG_LEVEL 0
ampembeng 15:6f2798e45099 31
ampembeng 15:6f2798e45099 32 #ifndef _IOT_LOG_H
ampembeng 15:6f2798e45099 33 #define _IOT_LOG_H
ampembeng 15:6f2798e45099 34
ampembeng 15:6f2798e45099 35 #include <stdio.h>
ampembeng 15:6f2798e45099 36 #include <stdlib.h>
ampembeng 15:6f2798e45099 37 #include "platform.h"
ampembeng 15:6f2798e45099 38
ampembeng 15:6f2798e45099 39 // Exposes USB Serial function
ampembeng 15:6f2798e45099 40 void pc_print(const char * format, ...);
ampembeng 15:6f2798e45099 41
ampembeng 15:6f2798e45099 42 /**
ampembeng 15:6f2798e45099 43 * @brief Debug level logging macro.
ampembeng 15:6f2798e45099 44 *
ampembeng 15:6f2798e45099 45 * Macro to expose function, line number as well as desired log message.
ampembeng 15:6f2798e45099 46 */
ampembeng 15:6f2798e45099 47 #ifdef IOT_DEBUG
ampembeng 15:6f2798e45099 48 #define DEBUG(...) \
ampembeng 15:6f2798e45099 49 {\
ampembeng 15:6f2798e45099 50 printf("DEBUG: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \
ampembeng 15:6f2798e45099 51 printf(__VA_ARGS__); \
ampembeng 15:6f2798e45099 52 printf("\n"); \
ampembeng 15:6f2798e45099 53 }
ampembeng 15:6f2798e45099 54 #else
ampembeng 15:6f2798e45099 55
ampembeng 15:6f2798e45099 56 #if DEBUG_LEVEL > 0
ampembeng 15:6f2798e45099 57 #define DEBUG(...) pc_print(__VA_ARGS__); \
ampembeng 15:6f2798e45099 58 pc_print("\r\n");
ampembeng 15:6f2798e45099 59 #else
ampembeng 15:6f2798e45099 60 #define DEBUG(...)
ampembeng 15:6f2798e45099 61 #endif
ampembeng 15:6f2798e45099 62
ampembeng 15:6f2798e45099 63 #endif
ampembeng 15:6f2798e45099 64
ampembeng 15:6f2798e45099 65 /**
ampembeng 15:6f2798e45099 66 * @brief Info level logging macro.
ampembeng 15:6f2798e45099 67 *
ampembeng 15:6f2798e45099 68 * Macro to expose desired log message. Info messages do not include automatic function names and line numbers.
ampembeng 15:6f2798e45099 69 */
ampembeng 15:6f2798e45099 70 #ifdef IOT_INFO
ampembeng 15:6f2798e45099 71 #define INFO(...) \
ampembeng 15:6f2798e45099 72 {\
ampembeng 15:6f2798e45099 73 printf(__VA_ARGS__); \
ampembeng 15:6f2798e45099 74 printf("\n"); \
ampembeng 15:6f2798e45099 75 }
ampembeng 15:6f2798e45099 76 #else
ampembeng 15:6f2798e45099 77 #define INFO(...) pc_print(__VA_ARGS__); \
ampembeng 15:6f2798e45099 78 pc_print("\r\n");
ampembeng 15:6f2798e45099 79 #endif
ampembeng 15:6f2798e45099 80
ampembeng 15:6f2798e45099 81 /**
ampembeng 15:6f2798e45099 82 * @brief Warn level logging macro.
ampembeng 15:6f2798e45099 83 *
ampembeng 15:6f2798e45099 84 * Macro to expose function, line number as well as desired log message.
ampembeng 15:6f2798e45099 85 */
ampembeng 15:6f2798e45099 86 #ifdef IOT_WARN
ampembeng 15:6f2798e45099 87 #define WARN(...) \
ampembeng 15:6f2798e45099 88 { \
ampembeng 15:6f2798e45099 89 printf("WARN: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \
ampembeng 15:6f2798e45099 90 printf(__VA_ARGS__); \
ampembeng 15:6f2798e45099 91 printf("\n"); \
ampembeng 15:6f2798e45099 92 }
ampembeng 15:6f2798e45099 93 #else
ampembeng 15:6f2798e45099 94 #define WARN(...) pc_print("WARN: "); \
ampembeng 15:6f2798e45099 95 pc_print(__VA_ARGS__); \
ampembeng 15:6f2798e45099 96 pc_print("\r\n");
ampembeng 15:6f2798e45099 97 #endif
ampembeng 15:6f2798e45099 98
ampembeng 15:6f2798e45099 99 /**
ampembeng 15:6f2798e45099 100 * @brief Error level logging macro.
ampembeng 15:6f2798e45099 101 *
ampembeng 15:6f2798e45099 102 * Macro to expose function, line number as well as desired log message.
ampembeng 15:6f2798e45099 103 */
ampembeng 15:6f2798e45099 104 #ifdef IOT_ERROR
ampembeng 15:6f2798e45099 105 #define ERROR(...) \
ampembeng 15:6f2798e45099 106 { \
ampembeng 15:6f2798e45099 107 printf("ERROR: %s L#%d ", __PRETTY_FUNCTION__, __LINE__); \
ampembeng 15:6f2798e45099 108 printf(__VA_ARGS__); \
ampembeng 15:6f2798e45099 109 printf("\n"); \
ampembeng 15:6f2798e45099 110 }
ampembeng 15:6f2798e45099 111 #else
ampembeng 15:6f2798e45099 112 #define ERROR(...) pc_print("ERROR: "); \
ampembeng 15:6f2798e45099 113 pc_print(__VA_ARGS__); \
ampembeng 15:6f2798e45099 114 pc_print("\r\n");
ampembeng 15:6f2798e45099 115 #endif
ampembeng 15:6f2798e45099 116
ampembeng 15:6f2798e45099 117 #endif // _IOT_LOG_H
ampembeng 15:6f2798e45099 118
ampembeng 15:6f2798e45099 119