aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/include
diff options
context:
space:
mode:
authorFilip Wandzio <contact@philw.dev>2025-09-04 22:25:39 +0200
committerFilip Wandzio <contact@philw.dev>2025-09-04 22:25:39 +0200
commit1ba21da6cbc63c0c549fb92731e25bedc482eb51 (patch)
treeddf6fc2259a2495f8de336a07873cc3c6796785e /firmware/include
parente00f3a9ede1b8e46b480bd68daf48da0bb08acae (diff)
downloade1-1ba21da6cbc63c0c549fb92731e25bedc482eb51.tar.gz
e1-1ba21da6cbc63c0c549fb92731e25bedc482eb51.zip
Unify the directory, add new analysis methods, unify the code style
Signed-off-by: Filip Wandzio <contact@philw.dev>
Diffstat (limited to 'firmware/include')
-rw-r--r--firmware/include/config.h21
-rw-r--r--firmware/include/mqtt.h15
-rw-r--r--firmware/include/wifi.h17
-rw-r--r--firmware/include/wifi_scan.h12
4 files changed, 65 insertions, 0 deletions
diff --git a/firmware/include/config.h b/firmware/include/config.h
new file mode 100644
index 0000000..467e1f7
--- /dev/null
+++ b/firmware/include/config.h
@@ -0,0 +1,21 @@
1#ifndef CONFIG_H
2#define CONFIG_H
3
4#define PUB_TOPIC "device/echo/in"
5#define SUB_TOPIC "device/echo/out"
6#define PUBLISH_INTERVAL_MS 1000
7#define BUFFER_SIZE 32
8
9#ifndef WIFI_SSID
10#define WIFI_SSID "UNKNOWN"
11#endif
12
13#ifndef WIFI_PASS
14#define WIFI_PASS "UNKNOWN"
15#endif
16
17#ifndef MQTT_URI
18#define MQTT_URI "mqtt://0.0.0.0"
19#endif
20
21#endif
diff --git a/firmware/include/mqtt.h b/firmware/include/mqtt.h
new file mode 100644
index 0000000..4f46b5a
--- /dev/null
+++ b/firmware/include/mqtt.h
@@ -0,0 +1,15 @@
1#ifndef MQTT_H
2#define MQTT_H
3
4#include "mqtt_client.h"
5
6/**
7 * @brief Starts the MQTT application.
8 *
9 * Initializes the MQTT client, registers event handlers,
10 * and starts the MQTT client. Also creates the publisher task
11 * that periodically sends messages.
12 */
13void mqtt_app_start(void);
14
15#endif
diff --git a/firmware/include/wifi.h b/firmware/include/wifi.h
new file mode 100644
index 0000000..bdcbe76
--- /dev/null
+++ b/firmware/include/wifi.h
@@ -0,0 +1,17 @@
1#ifndef WIFI_H
2#define WIFI_H
3
4#include "esp_wifi.h"
5#include "wifi_scan.h"
6
7/**
8 * @brief Initializes the WiFi interface in station mode.
9 *
10 * Sets up the default WiFi station network interface,
11 * initializes the WiFi driver with default configurations,
12 * starts WiFi, scans for available networks, and connects to
13 * the configured SSID and password.
14 */
15void wifi_init_sta(void);
16
17#endif
diff --git a/firmware/include/wifi_scan.h b/firmware/include/wifi_scan.h
new file mode 100644
index 0000000..dc18e7c
--- /dev/null
+++ b/firmware/include/wifi_scan.h
@@ -0,0 +1,12 @@
1#ifndef WIFI_SCAN_H
2#define WIFI_SCAN_H
3
4/**
5 * @brief Starts scanning for available WiFi networks.
6 *
7 * This function triggers the WiFi hardware to scan
8 * for nearby WiFi access points asynchronously.
9 */
10void wifi_scan_start(void);
11
12#endif // WIFI_SCAN_H