espnowSimple 1
Loading...
Searching...
No Matches
espnowsimple.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2* "THE BEER-WARE LICENSE":
3* <jensd@jensd.dk/jdn@es.aau.dk> wrote this file. As long as you retain this notice you
4* can do whatever you want with this stuff. If we meet some day, and you think
5* this stuff is worth it, you can buy me a beer in return.
6* Jens Dalsgaard Nielsen April 2024
7* ----------------------------------------------------------------------------
8*
9* Heavily inspired by
10* Copyright (c) 2023 Samuli Nyman
11* SPDX-License-Identifier: MIT
12* http://cansat.fi
13*/
14
15#ifndef ESPSIMPLENOW
16
17#define ESPSIMPLENOW
18
19
20#include <esp_now.h>
21#include <esp_wifi.h>
22#include <WiFi.h>
23
24#define ESPNOW_SIMPLE_DATA_LGT 100
25
26typedef struct {
27 uint8_t pkgTp; // should
28 uint32_t seqNr;;
29 unsigned long time;
32
33extern esp_err_t espNowSimpleErr; // Value 0 means noError !
34
35extern uint8_t espSimpleNowRunning; // false(0)) if not running, true running
36
37// callbacks required from esp-now library
38// our interface - radio callback interface
39// empty for now
40
41
53__attribute__((weak)) void espSimpleNowCallbackBinRcvd(const uint8_t *data, int len);
54
55
69__attribute__((weak)) void espSimpleNowCallbackDataSent(const bool success);
70
90uint8_t espSimpleNowInit(uint8_t macAddrLastByte);
91
92
98void espSimpleNowSetMacAddr(uint8_t mac[6]);
99
105void espSimpleNowGetMacAddr(uint8_t mac[6]);
106
113uint8_t espSimpleNowBroadcastData(char *data, uint16_t len);
114
115
116#endif
esp_err_t espNowSimpleErr
uint8_t espSimpleNowRunning
void espSimpleNowCallbackBinRcvd(const uint8_t *data, int len)
void espSimpleNowCallbackDataSent(const bool success)
uint8_t espSimpleNowBroadcastData(char *data, uint16_t len)
uint8_t espSimpleNowInit(uint8_t macAddrLastByte)
void espSimpleNowSetMacAddr(uint8_t mac[6])
#define ESPNOW_SIMPLE_DATA_LGT
void espSimpleNowGetMacAddr(uint8_t mac[6])
unsigned long time