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