39 lines
1.4 KiB
C
39 lines
1.4 KiB
C
#ifndef ESP_NOW_CORE_H
|
|
#define ESP_NOW_CORE_H
|
|
|
|
#include "app_config.h"
|
|
#include "esp_err.h"
|
|
#include "esp_now_messages.pb.h"
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
void esp_now_core_store_config(const app_config_t *config);
|
|
const app_config_t *esp_now_core_get_config(void);
|
|
bool esp_now_core_is_master(void);
|
|
uint8_t esp_now_core_network(void);
|
|
uint8_t esp_now_core_wifi_channel(void);
|
|
const uint8_t *esp_now_core_own_mac(void);
|
|
|
|
uint32_t esp_now_core_now_ms(void);
|
|
bool esp_now_core_mac_equal(const uint8_t *a, const uint8_t *b);
|
|
void esp_now_core_mac_to_str(const uint8_t *mac, char *out, size_t out_len);
|
|
|
|
esp_err_t esp_now_core_ensure_peer(const uint8_t *mac);
|
|
esp_err_t esp_now_core_ensure_broadcast_peer(void);
|
|
|
|
esp_err_t esp_now_core_send(const uint8_t *dest_mac,
|
|
const alox_EspNowMessage *msg);
|
|
/** Like send but does not wait for esp_now send-done (lower latency). */
|
|
esp_err_t esp_now_core_send_fast(const uint8_t *dest_mac,
|
|
const alox_EspNowMessage *msg);
|
|
esp_err_t esp_now_core_send_wait(const uint8_t *dest_mac,
|
|
const alox_EspNowMessage *msg);
|
|
/** OTA payloads: wait for send-done with extra NO_MEM backoff (queue drain). */
|
|
esp_err_t esp_now_core_send_reliable(const uint8_t *dest_mac,
|
|
const alox_EspNowMessage *msg);
|
|
|
|
esp_err_t esp_now_core_init_radio(uint8_t channel);
|
|
void esp_now_core_init_send_done(void);
|
|
|
|
#endif
|