mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Integrate RPC with RMT
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include "esp_log.h"
|
||||
|
||||
[[noreturn]] void LoopManager::control_loop() {
|
||||
const auto messaging_interface = std::make_unique<MessagingInterface>();
|
||||
const auto messaging_interface = std::make_unique<MessagingInterface>(std::make_unique<WifiManager>());
|
||||
|
||||
char buffer[512];
|
||||
while (true) {
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
char s[21] = {'H', 'e', 'l', 'l', 'o', ' ', 'f', 'r', 'o', 'm', ' ', 't', 'h', 'e', ' ', 'B', 'O', 'A', 'R', 'D', '!' };
|
||||
messaging_interface->send(s, 21, 1, 2, true);
|
||||
messaging_interface->send(s, 21, 5, 2, true);
|
||||
|
||||
ESP_LOGI("MEM", "Free internal RAM: %d", heap_caps_get_free_size(MALLOC_CAP_8BIT));
|
||||
ESP_LOGI("MEM", "Free PSRAM: %d", heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
|
||||
|
||||
@@ -185,29 +185,7 @@ void multi_transceiver(void* arg) {
|
||||
iteration++;
|
||||
if (iteration == 10){
|
||||
iteration = 0;
|
||||
// if (!receive_only){
|
||||
// matrix_size = RIP_MAX_ROUTES;
|
||||
// res = obj->get_network_toplogy(matrix, &matrix_size);
|
||||
// if (res != ESP_OK){
|
||||
// ESP_LOGE("multi", "Failed to get topology");
|
||||
// } else {
|
||||
// for (int i = 0; i < matrix_size; i++){
|
||||
// printf("Table for board %d:\n", matrix[i].board_id);
|
||||
// printf("board_id\t\tHops\t\tChannel\n");
|
||||
// for (int j = 0; j < matrix[i].size; j++){
|
||||
// printf("%d\t\t%d\t\t%d\n", matrix[i].table[j].info.board_id, matrix[i].table[j].info.hops, matrix[i].table[j].channel);
|
||||
// }
|
||||
// printf("=====\n");
|
||||
|
||||
// //reset matrix
|
||||
// matrix[i].size = RIP_MAX_ROUTES;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// vTaskDelay(1000 / portTICK_PERIOD_MS); // wait 1 second before trying to send again
|
||||
//reset temp buffers
|
||||
memset(recv_buf, 0, DATA_SIZE_TEST);
|
||||
memset(send_buf, 0, DATA_SIZE_TEST);
|
||||
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
//mdns and other stuff main file
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "freertos/queue.h"
|
||||
|
||||
#include "WifiManager.h"
|
||||
#include "mDNSDiscoveryService.h"
|
||||
#include "TCPServer.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "constants/tcp.h"
|
||||
#include "LoopManager.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
@@ -20,11 +16,5 @@ extern "C" [[noreturn]] void app_main(void) {
|
||||
ESP_LOGI("MEM", "Free PSRAM: %d", heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
|
||||
|
||||
ConfigManager::init_config();
|
||||
|
||||
const auto manager = std::make_unique<WifiManager>();
|
||||
manager->connect();
|
||||
|
||||
mDNSDiscoveryService::setup();
|
||||
|
||||
LoopManager::control_loop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user