no-OS
common_data.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef __COMMON_DATA_H__
40 #define __COMMON_DATA_H__
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include "platform_includes.h"
46 #include "no_os_uart.h"
47 #include "no_os_timer.h"
48 #include "no_os_gpio.h"
49 #include "no_os_irq.h"
50 
51 /******************************************************************************/
52 /********************** Macros and Constants Definitions **********************/
53 /******************************************************************************/
54 
55 /* Configure to which mqtt server to connect */
56 
57 /* Connect to local mqtt broker */
58 #define LOCAL 0
59 /* Connect to online broker */
60 #define TEST_MOSQUITTO 1
61 #define MQTT_ECLIPSE 2
62 
63 #if SERVER_TO_USE==TEST_MOSQUITTO
64 #define SERVER_ADDR "test.mosquitto.org"
65 #elif SERVER_TO_USE==MQTT_ECLIPSE
66 #define SERVER_ADDR "mqtt.eclipse.org"
67 #else //local
68 #define SERVER_ADDR "10.76.84.237"
69 #endif
70 
71 #define SERVER_PORT 1883
72 
73 /* Maximum buffer size for a message received from mqtt broker */
74 #define BUFF_LEN 200
75 
76 /* Wifi network parameters */
77 #define WIFI_SSID "WifiSSID"
78 #define WIFI_PASS "Password"
79 
80 /* Mqtt configuration */
81 #define MQTT_PUBLISH_TOPIC "sensor"
82 #define MQTT_SUBSCRIBE_TOPIC "esp_messages"
83 #define MQTT_CONFIG_CMD_TIMEOUT 20000
84 #define MQTT_CONFIG_VERSION MQTT_VERSION_3_1
85 #define MQTT_CONFIG_KEEP_ALIVE 7200
86 #define MQTT_CONFIG_CLIENT_NAME "esp-client"
87 #define MQTT_CONFIG_CLI_USER NULL
88 #define MQTT_CONFIG_CLI_PASS NULL
89 #define MQTT_PAYLOAD_BUFF_LEN 100
90 
91 /* Time between each scan mq*/
92 #define SCAN_SENSOR_TIME 500
93 
94 extern struct no_os_uart_init_param uart_ip;
95 extern struct no_os_irq_init_param irq_ip;
96 extern struct no_os_timer_init_param timer_ip;
98 
99 #endif /* __COMMON_DATA_H__ */
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
no_os_irq.h
Header file of IRQ interface.
uart_ip
struct no_os_uart_init_param uart_ip
Definition: common_data.c:58
no_os_timer.h
Timer control module header.
gpio_wifi_rst_ip
struct no_os_gpio_init_param gpio_wifi_rst_ip
Definition: common_data.c:74
irq_ip
struct no_os_irq_init_param irq_ip
Definition: common_data.c:60
no_os_timer_init_param
Structure holding the parameters for timer initialization.
Definition: no_os_timer.h:89
no_os_uart_init_param
Structure holding the parameters for UART initialization.
Definition: no_os_uart.h:116
no_os_irq_init_param
Structure holding the initial parameters for Interrupt Request.
Definition: no_os_irq.h:113
no_os_gpio.h
Header file of GPIO Interface.
no_os_uart.h
Header file of UART interface.
timer_ip
struct no_os_timer_init_param timer_ip
Definition: common_data.c:66