diff options
| author | Filip Wandzio <contact@philw.dev> | 2025-09-04 22:25:39 +0200 |
|---|---|---|
| committer | Filip Wandzio <contact@philw.dev> | 2025-09-04 22:25:39 +0200 |
| commit | 1ba21da6cbc63c0c549fb92731e25bedc482eb51 (patch) | |
| tree | ddf6fc2259a2495f8de336a07873cc3c6796785e /analysis/rtt/src/main.c | |
| parent | e00f3a9ede1b8e46b480bd68daf48da0bb08acae (diff) | |
| download | e1-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 'analysis/rtt/src/main.c')
| -rw-r--r-- | analysis/rtt/src/main.c | 28 |
1 files changed, 28 insertions, 0 deletions
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 @@ | |||
| 1 | |||
| 2 | #include "logger.h" | ||
| 3 | #include "mqtt_client.h" | ||
| 4 | #include <stdio.h> | ||
| 5 | |||
| 6 | #define BROKER_ADDRESS "192.168.1.101" | ||
| 7 | #define BROKER_PORT 1883 | ||
| 8 | #define TOPIC "device/echo/in" | ||
| 9 | #define CSV_FILE "rtt_throughput_log.csv" | ||
| 10 | |||
| 11 | int main() { | ||
| 12 | mqtt_client_t client; | ||
| 13 | |||
| 14 | logger_init(CSV_FILE); | ||
| 15 | |||
| 16 | if (mqtt_client_init(&client, BROKER_ADDRESS, BROKER_PORT, TOPIC) != 0) { | ||
| 17 | fprintf(stderr, "MQTT initialization error\n"); | ||
| 18 | return 1; | ||
| 19 | } | ||
| 20 | |||
| 21 | printf("Connection established.Waiting for messages...\n"); | ||
| 22 | mqtt_client_loop(&client); | ||
| 23 | |||
| 24 | logger_cleanup(); | ||
| 25 | mqtt_client_cleanup(&client); | ||
| 26 | |||
| 27 | return 0; | ||
| 28 | } | ||
