mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-09-30 21:31:06 +00:00
ESP-IDF Robot ESP NOW
This commit is contained in:
@@ -73,6 +73,8 @@ static uint8_t s_led_state = 0;
|
|||||||
/* ESP NOW*/
|
/* ESP NOW*/
|
||||||
#define ESPNOW_MAXDELAY 512
|
#define ESPNOW_MAXDELAY 512
|
||||||
static QueueHandle_t espnow_queue;
|
static QueueHandle_t espnow_queue;
|
||||||
|
static uint8_t broadcast_mac[ESP_NOW_ETH_ALEN] = {};
|
||||||
|
static uint8_t espnow_seq[ESPNOW_DATA_MAX] = {0, 0};
|
||||||
static uint8_t espnow_broadcast_mac[ESP_NOW_ETH_ALEN] = {};
|
static uint8_t espnow_broadcast_mac[ESP_NOW_ETH_ALEN] = {};
|
||||||
typedef struct struct_message {
|
typedef struct struct_message {
|
||||||
char node[32];
|
char node[32];
|
||||||
@@ -221,7 +223,7 @@ static void wifi_init()
|
|||||||
ESP_ERROR_CHECK( esp_wifi_set_channel(CONFIG_ESPNOW_CHANNEL, WIFI_SECOND_CHAN_NONE));
|
ESP_ERROR_CHECK( esp_wifi_set_channel(CONFIG_ESPNOW_CHANNEL, WIFI_SECOND_CHAN_NONE));
|
||||||
}
|
}
|
||||||
static void espnow_send_cb (const uint8_t *mac_addr, esp_now_send_status_t status) {
|
static void espnow_send_cb (const uint8_t *mac_addr, esp_now_send_status_t status) {
|
||||||
|
|
||||||
}
|
}
|
||||||
static void espnow_receive_cb (const esp_now_recv_info_t *recv_info, const uint8_t *data, int len) {
|
static void espnow_receive_cb (const esp_now_recv_info_t *recv_info, const uint8_t *data, int len) {
|
||||||
espnow_event_t evt;
|
espnow_event_t evt;
|
||||||
|
@@ -42,9 +42,9 @@ typedef struct {
|
|||||||
} espnow_event_t;
|
} espnow_event_t;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
EXAMPLE_ESPNOW_DATA_BROADCAST,
|
ESPNOW_DATA_BROADCAST,
|
||||||
EXAMPLE_ESPNOW_DATA_UNICAST,
|
ESPNOW_DATA_UNICAST,
|
||||||
EXAMPLE_ESPNOW_DATA_MAX,
|
ESPNOW_DATA_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
Reference in New Issue
Block a user