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