From 1ba21da6cbc63c0c549fb92731e25bedc482eb51 Mon Sep 17 00:00:00 2001 From: Filip Wandzio Date: Thu, 4 Sep 2025 22:25:39 +0200 Subject: Unify the directory, add new analysis methods, unify the code style Signed-off-by: Filip Wandzio --- analysis/rtt/src/main.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 analysis/rtt/src/main.c (limited to 'analysis/rtt/src/main.c') diff --git a/analysis/rtt/src/main.c b/analysis/rtt/src/main.c new file mode 100644 index 0000000..13f7716 --- /dev/null +++ b/analysis/rtt/src/main.c @@ -0,0 +1,28 @@ + +#include "logger.h" +#include "mqtt_client.h" +#include + +#define BROKER_ADDRESS "192.168.1.101" +#define BROKER_PORT 1883 +#define TOPIC "device/echo/in" +#define CSV_FILE "rtt_throughput_log.csv" + +int main() { + mqtt_client_t client; + + logger_init(CSV_FILE); + + if (mqtt_client_init(&client, BROKER_ADDRESS, BROKER_PORT, TOPIC) != 0) { + fprintf(stderr, "MQTT initialization error\n"); + return 1; + } + + printf("Connection established.Waiting for messages...\n"); + mqtt_client_loop(&client); + + logger_cleanup(); + mqtt_client_cleanup(&client); + + return 0; +} -- cgit v1.2.3