MeterLogger
espnow.h
Go to the documentation of this file.
1 /*
2  * ESPRSSIF MIT License
3  *
4  * Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
5  *
6  * Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
7  * it is free of charge, to any person obtaining a copy of this software and associated
8  * documentation files (the "Software"), to deal in the Software without restriction, including
9  * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the Software is furnished
11  * to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or
14  * substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  */
24 
25 #ifndef __ESPNOW_H__
26 #define __ESPNOW_H__
27 
34 };
35 
36 typedef void (*esp_now_recv_cb_t)(u8 *mac_addr, u8 *data, u8 len);
37 typedef void (*esp_now_send_cb_t)(u8 *mac_addr, u8 status);
38 
39 int esp_now_init(void);
40 int esp_now_deinit(void);
41 
44 
47 
48 int esp_now_send(u8 *da, u8 *data, int len);
49 
50 int esp_now_add_peer(u8 *mac_addr, u8 role, u8 channel, u8 *key, u8 key_len);
51 int esp_now_del_peer(u8 *mac_addr);
52 
53 int esp_now_set_self_role(u8 role);
54 int esp_now_get_self_role(void);
55 
56 int esp_now_set_peer_role(u8 *mac_addr, u8 role);
57 int esp_now_get_peer_role(u8 *mac_addr);
58 
59 int esp_now_set_peer_channel(u8 *mac_addr, u8 channel);
60 int esp_now_get_peer_channel(u8 *mac_addr);
61 
62 int esp_now_set_peer_key(u8 *mac_addr, u8 *key, u8 key_len);
63 int esp_now_get_peer_key(u8 *mac_addr, u8 *key, u8 *key_len);
64 
65 u8 *esp_now_fetch_peer(bool restart);
66 
67 int esp_now_is_peer_exist(u8 *mac_addr);
68 
69 int esp_now_get_cnt_info(u8 *all_cnt, u8 *encrypt_cnt);
70 
71 int esp_now_set_kok(u8 *key, u8 len);
72 
73 #endif
esp_now_role
Definition: espnow.h:28
u16_t len
Definition: pbuf.h:93
int esp_now_unregister_recv_cb(void)
int esp_now_add_peer(u8 *mac_addr, u8 role, u8 channel, u8 *key, u8 key_len)
int esp_now_send(u8 *da, u8 *data, int len)
int esp_now_init(void)
int esp_now_get_cnt_info(u8 *all_cnt, u8 *encrypt_cnt)
int esp_now_set_self_role(u8 role)
int esp_now_del_peer(u8 *mac_addr)
int esp_now_set_peer_role(u8 *mac_addr, u8 role)
int esp_now_get_self_role(void)
int esp_now_unregister_send_cb(void)
int esp_now_is_peer_exist(u8 *mac_addr)
int esp_now_set_peer_key(u8 *mac_addr, u8 *key, u8 key_len)
void(* esp_now_recv_cb_t)(u8 *mac_addr, u8 *data, u8 len)
Definition: espnow.h:36
int esp_now_set_kok(u8 *key, u8 len)
int esp_now_register_recv_cb(esp_now_recv_cb_t cb)
int esp_now_get_peer_role(u8 *mac_addr)
int esp_now_get_peer_channel(u8 *mac_addr)
unsigned char u8
Definition: c_types.h:46
int esp_now_deinit(void)
int esp_now_get_peer_key(u8 *mac_addr, u8 *key, u8 *key_len)
int esp_now_set_peer_channel(u8 *mac_addr, u8 channel)
u8 * esp_now_fetch_peer(bool restart)
static const char key[]
Definition: config.h:42
int esp_now_register_send_cb(esp_now_send_cb_t cb)
void(* esp_now_send_cb_t)(u8 *mac_addr, u8 status)
Definition: espnow.h:37