|
espnowSimple 1
|
#include <esp_now.h>#include <esp_wifi.h>#include <WiFi.h>

Go to the source code of this file.
Data Structures | |
| struct | espNowSimplePkg |
Macros | |
| #define | ESPNOW_SIMPLE_DATA_LGT 100 |
Functions | |
| void | espSimpleNowCallbackBinRcvd (const uint8_t *data, int len) |
| void | espSimpleNowCallbackDataSent (const bool success) |
| uint8_t | espSimpleNowInit (uint8_t macAddrLastByte) |
| void | espSimpleNowSetMacAddr (uint8_t mac[6]) |
| void | espSimpleNowGetMacAddr (uint8_t mac[6]) |
| uint8_t | espSimpleNowBroadcastData (char *data, uint16_t len) |
Variables | |
| esp_err_t | espNowSimpleErr |
| uint8_t | espSimpleNowRunning |
| #define ESPNOW_SIMPLE_DATA_LGT 100 |
Definition at line 24 of file espnowsimple.h.
| uint8_t espSimpleNowBroadcastData | ( | char * | data, |
| uint16_t | len ) |
Simple binary data tx NB max size 250Byte pls use max 249 just to be sure
Definition at line 130 of file espnowsimple.cpp.
References broadcastMAC, and espSimpleNowRunning.
Referenced by txTest().

| void espSimpleNowCallbackBinRcvd | ( | const uint8_t * | data, |
| int | len ) |
The callback you shall implement as to get data
void espSimpleNowCallbackBinRcvd(const uint8_t *data, int len) { your code }
the receiving function just copy the received package to local storage You might do it better by implementing a buffer system
Definition at line 33 of file espnowsimple.cpp.
References arSize, rxCount, rxData, rxPkg, rxPkg2, and txData.
Referenced by internalDataReceivedCallback().

| void espSimpleNowCallbackDataSent | ( | const bool | success | ) |
The callback you shall implement as to check if data has been send NB esp now do not guarantee if data is received in same order as you did tx - ifff you are heavily loading the system
void espSimpleNowCallbackDataSent(const bool success) { }
to check if data has been send to get data
Definition at line 34 of file espnowsimple.cpp.
Referenced by internalDataSentCallback().

| void espSimpleNowGetMacAddr | ( | uint8_t | mac[6] | ) |
you can get current mac addr
Definition at line 148 of file espnowsimple.cpp.
References broadcastMAC.
Referenced by testMacAddr().

| uint8_t espSimpleNowInit | ( | uint8_t | macAddrLastByte | ) |
change last byte in MAC to To used for broadcast See esp now library NB parm must not n“edn on 1,3,5,7 (decimal) or just lsb bit must not be 1 return: -1 if macaddressbyte i odd - must be even (lsb bit0 ==0) rest of err codes comes from call to initESPNowMac 1: esp_wifi_sec_mac failed 2: esp_now_init failed 3: esp_wifi_set_protocol failed 4: esp_now_register_send_cb failed 5: esp_now_register_recv_cb failed 6: esp_now_add_peer failed
espNowSimpleErr (of type esp_err_t) holds the actual errorcode
Definition at line 114 of file espnowsimple.cpp.
References broadcastMAC, initESPNowMac(), and setMacAddr().
Referenced by setup().


| void espSimpleNowSetMacAddr | ( | uint8_t | mac[6] | ) |
You can change broadcast mac address
Set new
Definition at line 142 of file espnowsimple.cpp.
References broadcastMAC.
Referenced by testMacAddr().

|
extern |
Definition at line 19 of file espnowsimple.cpp.
Referenced by initESPNowMac().
|
extern |
Definition at line 23 of file espnowsimple.cpp.
Referenced by espSimpleNowBroadcastData(), and initESPNowMac().