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

Dependencies:   SDFileSystem

Fork of ATT_AWS_IoT_demo by Anthony Phillips

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MQTTMessage.h Source File

MQTTMessage.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License").
00005  * You may not use this file except in compliance with the License.
00006  * A copy of the License is located at
00007  *
00008  *  http://aws.amazon.com/apache2.0
00009  *
00010  * or in the "license" file accompanying this file. This file is distributed
00011  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
00012  * express or implied. See the License for the specific language governing
00013  * permissions and limitations under the License.
00014  */
00015 
00016 /**
00017  * @file MQTTMessage.h
00018  * @brief Definition of Messages for the MQTT Client
00019  */
00020 
00021 #ifndef __MQTT_MESSAGE_H
00022 #define __MQTT_MESSAGE_H
00023 
00024 /* Enum order should match the packet ids array defined in MQTTFormat.c */
00025 typedef enum msgTypes {
00026     UNKNOWN = -1,
00027     CONNECT = 1,
00028     CONNACK = 2,
00029     PUBLISH = 3,
00030     PUBACK = 4,
00031     PUBREC = 5,
00032     PUBREL = 6,
00033     PUBCOMP = 7,
00034     SUBSCRIBE = 8,
00035     SUBACK = 9,
00036     UNSUBSCRIBE = 10,
00037     UNSUBACK = 11,
00038     PINGREQ = 12,
00039     PINGRESP = 13,
00040     DISCONNECT = 14
00041 }MessageTypes;
00042 
00043 typedef enum QoS {
00044     QOS0 = 0,
00045     QOS1 = 1,
00046     QOS2 = 2
00047 }QoS;
00048 
00049 typedef struct {
00050     QoS qos;
00051     uint8_t retained;
00052     uint8_t dup;
00053     uint16_t id;
00054     void *payload;
00055     size_t payloadlen;
00056 }MQTTMessage;
00057 
00058 #endif //__MQTT_MESSAGE_H
00059 
00060