esp-tunnel/main/app_networking.hpp
2023-06-03 15:40:32 +03:00

32 lines
530 B
C++

#pragma once
#include <cstdint>
#include <array>
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
namespace 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 sendData(const std::array<std::uint8_t, 128>& buffer, const std::size_t length);
const std::array<std::uint8_t, 128>& getRxBuffer();
}// namespace App