ConOpSys V2970  P004.07
ANVILEX control operating system
mqtt_opts.h
Go to the documentation of this file.
1 /**
2  * @file
3  * MQTT client options
4  */
5 
6 /*
7  * Copyright (c) 2016 Erik Andersson
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without modification,
11  * are permitted provided that the following conditions are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright notice,
14  * this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  * 3. The name of the author may not be used to endorse or promote products
19  * derived from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
22  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
24  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
30  * OF SUCH DAMAGE.
31  *
32  * This file is part of the lwIP TCP/IP stack.
33  *
34  * Author: Erik Andersson
35  *
36  */
37 #ifndef LWIP_HDR_APPS_MQTT_OPTS_H
38 #define LWIP_HDR_APPS_MQTT_OPTS_H
39 
40 #include "lwip/opt.h"
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /**
47  * @defgroup mqtt_opts Options
48  * @ingroup mqtt
49  * @{
50  */
51 
52 /**
53  * Output ring-buffer size, must be able to fit largest outgoing publish message topic+payloads
54  */
55 #ifndef MQTT_OUTPUT_RINGBUF_SIZE
56 #define MQTT_OUTPUT_RINGBUF_SIZE 256
57 #endif
58 
59 /**
60  * Number of bytes in receive buffer, must be at least the size of the longest incoming topic + 8
61  * If one wants to avoid fragmented incoming publish, set length to max incoming topic length + max payload length + 8
62  */
63 #ifndef MQTT_VAR_HEADER_BUFFER_LEN
64 #define MQTT_VAR_HEADER_BUFFER_LEN 128
65 #endif
66 
67 /**
68  * Maximum number of pending subscribe, unsubscribe and publish requests to server .
69  */
70 #ifndef MQTT_REQ_MAX_IN_FLIGHT
71 #define MQTT_REQ_MAX_IN_FLIGHT 4
72 #endif
73 
74 /**
75  * Seconds between each cyclic timer call.
76  */
77 #ifndef MQTT_CYCLIC_TIMER_INTERVAL
78 #define MQTT_CYCLIC_TIMER_INTERVAL 5
79 #endif
80 
81 /**
82  * Publish, subscribe and unsubscribe request timeout in seconds.
83  */
84 #ifndef MQTT_REQ_TIMEOUT
85 #define MQTT_REQ_TIMEOUT 30
86 #endif
87 
88 /**
89  * Seconds for MQTT connect response timeout after sending connect request
90  */
91 #ifndef MQTT_CONNECT_TIMOUT
92 #define MQTT_CONNECT_TIMOUT 100
93 #endif
94 
95 /**
96  * @}
97  */
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 #endif /* LWIP_HDR_APPS_MQTT_OPTS_H */