TI's MQTT Demo with freertos CM4F
Embed:
(wiki syntax)
Show/hide line numbers
mqtt_config.h
00001 /* 00002 * mqtt_config.h - MQTT Client configurations 00003 * 00004 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ 00005 * 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * 00014 * Redistributions in binary form must reproduce the above copyright 00015 * notice, this list of conditions and the following disclaimer in the 00016 * documentation and/or other materials provided with the 00017 * distribution. 00018 * 00019 * Neither the name of Texas Instruments Incorporated nor the names of 00020 * its contributors may be used to endorse or promote products derived 00021 * from this software without specific prior written permission. 00022 * 00023 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00024 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00025 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00026 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00027 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00028 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00029 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00030 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00031 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00032 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00033 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00034 * 00035 */ 00036 00037 #ifndef __MQTT_CONFIG_H__ 00038 #define __MQTT_CONFIG_H__ 00039 00040 //***************************************************************************** 00041 // 00042 // If building with a C++ compiler, make all of the definitions in this header 00043 // have a C binding. 00044 // 00045 //***************************************************************************** 00046 #ifdef __cplusplus 00047 extern "C" { 00048 #endif 00049 00050 /*Operate Lib in MQTT 3.1 mode.*/ 00051 #define MQTT_3_1_1 false /*MQTT 3.1.1 */ 00052 #define MQTT_3_1 true /*MQTT 3.1 */ 00053 00054 #define WILL_TOPIC "Client" 00055 #define WILL_MSG "Client Stopped" 00056 #define WILL_QOS QOS2 00057 #define WILL_RETAIN false 00058 00059 /*Defining Broker IP address and port Number*/ 00060 #define SERVER_ADDRESS "messagesight.demos.ibm.com" 00061 #define PORT_NUMBER 1883 00062 00063 /* Client ID must be unique*/ 00064 const char* CLIENT_ID = "WaterSnake"; 00065 #define MAX_BROKER_CONN 1 00066 #define SERVER_MODE MQTT_3_1 00067 00068 /*Specifying Receive time out for the Receive task*/ 00069 #define RCV_TIMEOUT 30 00070 00071 /* Keep Alive Timer value in seconds. 00072 * Maximum time interval between messages received from a client. 00073 */ 00074 #define KEEP_ALIVE_TIMER 25 00075 00076 /* Clean session flag. The server must discard any previously 00077 * maintained information about the client. 00078 */ 00079 #define CLEAN_SESSION true 00080 00081 /* Retain Flag. Used in publish message. 00082 * The server should hold on to the publish message after it has 00083 * been delivered to the current subscribers. 00084 */ 00085 #define RETAIN 1 00086 00087 /* Defining Publish Topics */ 00088 #define PUB_TOPIC_1 "/cc3100/ButtonPressTopic1" 00089 #define PUB_TOPIC_2 "/cc3100/ButtonPressTopic2" 00090 00091 /* Defining number of subscribe topics */ 00092 #define SUB_TOPIC_COUNT 2 00093 00094 /* Defining Subscription Topics */ 00095 #define SUB_TOPIC1 "/cc3100/ToggleLEDCmdL1" 00096 #define SUB_TOPIC2 "/cc3100/ToggleLEDCmdL2" 00097 00098 /* Defining QOS levels */ 00099 #define QOS0 0 00100 #define QOS1 1 00101 #define QOS2 2 00102 00103 /* Task priorities and OSI Stack Size */ 00104 #define OSI_STACK_SIZE (2048) 00105 #define SPAWN_TASK_PRIORITY 7 //7 00106 #define MQTT_APP_TASK_PRIORITY 2 //2 00107 #define TASK_PRIORITY 2 //3 00108 00109 #define MAX_QUEUE_MSG 10 00110 00111 #define LOOPBACK_PORT_NUMBER 1882 00112 00113 #ifdef __cplusplus 00114 } 00115 #endif /* __cplusplus */ 00116 00117 #endif /*__MQTT_CONFIG_H__*/ 00118
Generated on Wed Jul 13 2022 09:55:38 by
1.7.2