esp_now_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Gunar Schorcht
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
21 #if defined(MODULE_ESP_NOW) || defined(DOXYGEN)
22 
32 #ifndef ESP_NOW_STACKSIZE
33 #define ESP_NOW_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
34 #endif
35 
41 #ifndef ESP_NOW_PRIO
42 #define ESP_NOW_PRIO (GNRC_NETIF_PRIO)
43 #endif
44 
50 #ifndef ESP_NOW_SCAN_PERIOD_MS
51 #define ESP_NOW_SCAN_PERIOD_MS (10000UL)
52 #endif
53 
58 #ifndef ESP_NOW_SOFT_AP_PASS
59 #define ESP_NOW_SOFT_AP_PASS "ThisistheRIOTporttoESP"
60 #endif
61 
66 #ifndef ESP_NOW_CHANNEL
67 #define ESP_NOW_CHANNEL (6)
68 #endif
69 
83 #ifndef ESP_NOW_KEY
84 #define ESP_NOW_KEY (NULL)
85 #endif
86 
92 #ifndef ESP_NOW_PARAMS
93 #define ESP_NOW_PARAMS { .key = ESP_NOW_KEY, \
94  .scan_period = ESP_NOW_SCAN_PERIOD_MS, \
95  .softap_pass = ESP_NOW_SOFT_AP_PASS, \
96  .channel = ESP_NOW_CHANNEL \
97  }
98 #endif
99 
103 typedef struct
104 {
105  const uint8_t* key;
106  uint32_t scan_period;
107  const char* softap_pass;
108  uint8_t channel;
111 
112 #ifdef __cplusplus
113 extern "C" {
114 #endif
115 
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif /* MODULE_ESP_NOW || DOXYGEN */
126 
#define ESP_NOW_PARAMS
Initializer for default configuration parameters.
static const esp_now_params_t esp_now_params
Static configuration structure.
Struct holding all parameters needed for device initialization.
const uint8_t * key
key of type uint8_t [16] or NULL (no encryption)
const char * softap_pass
Passphrase used for the SoftAP interface.
uint8_t channel
Channel used for ESP-NOW nodes.
uint32_t scan_period
Period at which the node scans for other nodes.