Peter Ferland / Cayenne-MQTT-mbed-M1

Dependents:   5_Dragonfly_Cayenne_Sprint_IKS01A1

Fork of Cayenne-MQTT-mbed-MTSAS by Peter Ferland

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CayenneDefines.h Source File

CayenneDefines.h

00001 /*
00002 The MIT License(MIT)
00003 
00004 Cayenne MQTT Client Library
00005 Copyright (c) 2016 myDevices
00006 
00007 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
00008 documentation files(the "Software"), to deal in the Software without restriction, including without limitation
00009 the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software,
00010 and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
00011 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
00012 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR
00014 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00015 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00016 */
00017 
00018 #ifndef _CAYENNEDEFINES_h
00019 #define _CAYENNEDEFINES_h
00020 
00021 #define CAYENNE_VERSION "v1"
00022 //#define CAYENNE_DOMAIN "mqtt.mydevices.com"
00023 #define CAYENNE_DOMAIN "52.205.152.120"
00024 #define CAYENNE_PORT 1883
00025 #define CAYENNE_TLS_PORT 8883
00026 
00027 #ifndef CAYENNE_MAX_MESSAGE_SIZE
00028 #define CAYENNE_MAX_MESSAGE_SIZE 134 // Redefine this for different message size
00029 #endif
00030 
00031 #ifndef CAYENNE_MAX_MESSAGE_HANDLERS
00032 #define CAYENNE_MAX_MESSAGE_HANDLERS 5 /* Redefine to change number of handlers */
00033 #endif
00034 
00035 #ifndef CAYENNE_MAX_MESSAGE_VALUES
00036 #define CAYENNE_MAX_MESSAGE_VALUES 4 /* Redefine to change max number of values in a message, must be at least 1 */
00037 #endif
00038 
00039 //Comment this out to prevent digital and analog specific code from being compiled. If you only need to send
00040 //and receive standard channel data you can comment this out to decrease the program size.
00041 //#define DIGITAL_AND_ANALOG_SUPPORT
00042 
00043 //Comment this out if you don't need to subscribe to data or system info payloads.
00044 //#define PARSE_INFO_PAYLOADS
00045 
00046 //Some defines for AVR microcontrollers to allow easier usage of memory in program space.
00047 #if defined(__AVR__) || defined(ARDUINO_ARCH_SAM)
00048 #include <avr/pgmspace.h>
00049 #define CAYENNE_USING_PROGMEM
00050 #define CAYENNE_PROGMEM PROGMEM
00051 #define CAYENNE_PSTR(s) PSTR(s)
00052 #define CAYENNE_STRLEN(s) strlen_P(s)
00053 #define CAYENNE_STRCAT(s1, s2) strcat_P(s1, s2)
00054 #define CAYENNE_STRNCMP(s1, s2, n) strncmp_P(s1, s2, n)
00055 #define CAYENNE_MEMCPY(s1, s2, n) memcpy_P(s1, s2, n)
00056 #define CAYENNE_READ_BYTE(b) pgm_read_byte(b);
00057 #else
00058 #define CAYENNE_PROGMEM
00059 #define CAYENNE_PSTR(s) s
00060 #define CAYENNE_STRLEN(s) strlen(s)
00061 #define CAYENNE_STRCAT(s1, s2) strcat(s1, s2)
00062 #define CAYENNE_STRNCMP(s1, s2, n) strncmp(s1, s2, n)
00063 #define CAYENNE_MEMCPY(s1, s2, n) memcpy(s1, s2, n)
00064 #define CAYENNE_READ_BYTE(b) *b;
00065 #endif
00066 
00067 #include "CayenneTypes.h"
00068 #include "CayenneTopics.h"
00069 
00070 #endif