updates to topology with flatbuffers

This commit is contained in:
superkor
2026-01-23 18:51:06 -05:00
parent 54128ef410
commit 335a8dcd55
8 changed files with 245 additions and 70 deletions

View File

@@ -12,6 +12,8 @@ To run the sample code, add the compiler variable `RMT_TEST=1` when compiling: `
With `main_rmt_test.cpp`, flash one or more boards, ensuring that `BOARD_ID` are unique and `RECEIVER_BOARD_ID` is a board that exists and is connected on the same network.
Please note that `SRC_BOARD` and `RECEIVER_BOARD` should be an 8 bit value (that is not 0x0 or 0xFF).
### Example Usage:
Board A: `idf.py -B ./build_A build -D SRC_BOARD=1 -D RECEIVER_BOARD=69 -D RMT_TEST=1 flash monitor -p COM3`
@@ -32,6 +34,14 @@ When monitoring both boards, you should see `Received message '%.*s' on channel
The specific message being sent can vary depending on the setup (determined at compile time). Simply changing the `snprintf` on the `send_buf` and/or `FrameType` argument of `send()` will change the message/frames being sent (from the perspective of the user).
# Preprogrammed Movements Sample Code
See `main_preprogrammed_test.cpp`.
To run the sample code, add the compiler variable `PP_MOVE=1` when compiling.
You can use the `SRC_BOARD` compiler variable to set a custom board id.
# cat
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⡷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

View File

@@ -1,4 +1,4 @@
#if !defined(RMT_TEST) || (defined(RMT_TEST) && RMT_TEST == 0)
#if (!defined(RMT_TEST) || (defined(RMT_TEST) && RMT_TEST == 0)) && (!defined(PP_MOVE) || (defined(PP_MOVE) && PP_MOVE == 0))
// #include <cstdio>
// #include <memory>

View File

@@ -0,0 +1,48 @@
#if (defined(RMT_TEST) && RMT_TEST == 0) && (!defined(PP_MOVE) || (defined(PP_MOVE) && PP_MOVE == 1))
#include <cstdio>
#include <memory>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_flash.h"
#include "nvs_flash.h"
#include "constants/datalink.h"
#include "TopologyManager.h"
#include <esp_netif.h>
#include <esp_event.h>
#include <freertos/semphr.h>
#include "driver/gptimer.h"
#include "esp_log.h"
#if !defined(SRC_BOARD)
const uint8_t BOARD_ID = 1;
#else
const uint8_t BOARD_ID = SRC_BOARD
#endif
extern "C" [[noreturn]] void app_main(void) {
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);
esp_netif_init();
esp_event_loop_create_default();
printf("finished esp init\n");
printf("Hello world!\n");
TopologyManager obj = TopologyManager();
while(true){
//do nothing
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
}
#endif

View File

@@ -1,4 +1,4 @@
#if defined(RMT_TEST) && RMT_TEST == 1
#if (defined(RMT_TEST) && RMT_TEST == 1) && (!defined(PP_MOVE) || (defined(PP_MOVE) && PP_MOVE == 0))
//Used for link layer testing (change name to main.cpp to use)
#include <cstdio>
#include <memory>