From 450ede0da0ddaaed034f310e1812cbc8cdabc8f5 Mon Sep 17 00:00:00 2001 From: Jens Wetterich Date: Sun, 10 Jan 2021 13:23:46 +0100 Subject: [PATCH] cpu/esp_common: Add missing includes and ISO-C++ compatibility --- cpu/esp_common/esp-now/esp_now_netdev.c | 2 +- cpu/esp_common/esp-now/esp_now_netdev.h | 5 +++++ cpu/esp_common/esp-now/esp_now_params.h | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cpu/esp_common/esp-now/esp_now_netdev.c b/cpu/esp_common/esp-now/esp_now_netdev.c index 4ba7a919ff..16ff296b06 100644 --- a/cpu/esp_common/esp-now/esp_now_netdev.c +++ b/cpu/esp_common/esp-now/esp_now_netdev.c @@ -65,7 +65,7 @@ static esp_now_netdev_t _esp_now_dev = { 0 }; static const netdev_driver_t _esp_now_driver; -static bool _esp_now_add_peer(const uint8_t* bssid, uint8_t channel, uint8_t* key) +static bool _esp_now_add_peer(const uint8_t* bssid, uint8_t channel, const uint8_t* key) { if (esp_now_is_peer_exist(bssid)) { return false; diff --git a/cpu/esp_common/esp-now/esp_now_netdev.h b/cpu/esp_common/esp-now/esp_now_netdev.h index 547c4758af..f2154254b9 100644 --- a/cpu/esp_common/esp-now/esp_now_netdev.h +++ b/cpu/esp_common/esp-now/esp_now_netdev.h @@ -21,6 +21,11 @@ #define ESP_NOW_NETDEV_H #include "net/netdev.h" +#include "mutex.h" +#include "net/ethernet/hdr.h" +#ifdef MODULE_GNRC +#include "net/gnrc/nettype.h" +#endif #ifdef __cplusplus extern "C" { diff --git a/cpu/esp_common/esp-now/esp_now_params.h b/cpu/esp_common/esp-now/esp_now_params.h index 289b246733..c0e61ef4e2 100644 --- a/cpu/esp_common/esp-now/esp_now_params.h +++ b/cpu/esp_common/esp-now/esp_now_params.h @@ -103,10 +103,10 @@ */ typedef struct { - uint8_t* key; /**< key of type uint8_t [16] or NULL (no encryption) */ - uint32_t scan_period; /**< Period at which the node scans for other nodes */ - char* softap_pass; /**< Passphrase used for the SoftAP interface */ - uint8_t channel; /**< Channel used for ESP-NOW nodes */ + const uint8_t* key; /**< key of type uint8_t [16] or NULL (no encryption) */ + uint32_t scan_period; /**< Period at which the node scans for other nodes */ + const char* softap_pass; /**< Passphrase used for the SoftAP interface */ + uint8_t channel; /**< Channel used for ESP-NOW nodes */ } esp_now_params_t;