esp-tunnel/main/app_networking.hpp

35 lines
636 B
C++

#pragma once
#include <cstdint>
#include <array>
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
namespace Networking
{
static const char* LOG_TAG = "Networking";
struct EspNowEvent
{
enum : std::uint8_t
{
MSG_RECEIVED,
MSG_SEND_COMPLETE
} type;
std::size_t rx_length;
};
using MacAddress = std::array<std::uint8_t, 6>;
void setupWifi();
[[nodiscard]] QueueHandle_t setupEspNow();
void sendHello();
void sendData(const std::array<std::uint8_t, CONFIG_ESPTNL_BUFFER_SIZE>& buffer, const std::size_t length);
const std::array<std::uint8_t, CONFIG_ESPTNL_BUFFER_SIZE>& getRxBuffer();
}// namespace App