ESP8266_RTOS_SDK v1.4.0

- Main Page
- Modules
- Data Structures
- Files

- File List

mesh.h
1 /*
2 * ESPRSSIF MIT License
3 *
4 * Copyright (c) 2015 <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 __LWIP_API_MESH_H__
26 #define __LWIP_API_MESH_H__
27
28 #include "lwip/ip_addr.h"
29 #include "espconn.h"
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 typedef void (* espconn_mesh_callback)();
36
37 enum mesh_type {
38 MESH_CLOSE = 0,
39 MESH_LOCAL,
40 MESH_ONLINE,
41 MESH_NONE = 0xFF
42 };
43
55 enum mesh_status {
56 MESH_DISABLE = 0,
57 MESH_WIFI_CONN,
58 MESH_NET_CONN,
59 MESH_LOCAL_AVAIL,
60 MESH_ONLINE_AVAIL
61 };
62
63 enum mesh_node_type {
64 MESH_NODE_PARENT = 0,
65 MESH_NODE_CHILD,
66 MESH_NODE_ALL
67 };
68
80 bool espconn_mesh_local_addr(struct ip_addr *ip);
81
92 bool espconn_mesh_get_node_info(enum mesh_node_type type,
93 uint8_t **info, uint8_t *count);
94
107 bool espconn_mesh_encrypt_init(AUTH_MODE mode, uint8_t *passwd, uint8_t passwd_len);
108
120 bool espconn_mesh_set_ssid_prefix(uint8_t *prefix, uint8_t prefix_len);
121
132 bool espconn_mesh_set_max_hops(uint8_t max_hops);
133
145 bool espconn_mesh_group_id_init(uint8_t *grp_id, uint16_t gid_len);
146
155 bool espconn_mesh_set_dev_type(uint8_t dev_type);
156
174 sint8 espconn_mesh_connect(struct espconn *usr_esp);
175
190 sint8 espconn_mesh_disconnect(struct espconn *usr_esp);
191
199 sint8 espconn_mesh_get_status();
200
218 sint8 espconn_mesh_sent(struct espconn *usr_esp, uint8 *pdata, uint16 len);
219
227 uint8 espconn_mesh_get_max_hops();
228
243 void espconn_mesh_enable(espconn_mesh_callback enable_cb, enum mesh_type type);
244
255 void espconn_mesh_disable(espconn_mesh_callback disable_cb);
256
264 void espconn_mesh_init();
265
270 #ifdef __cplusplus
271 }
272 #endif
273
274 #endif
espconn_mesh_set_dev_type
bool espconn_mesh_set_dev_type(uint8_t dev_type)
Set the curent device type.
espconn_mesh_set_max_hops
bool espconn_mesh_set_max_hops(uint8_t max_hops)
Set max hop for mesh network.
MESH_WIFI_CONN
Definition: mesh.h:57
AUTH_MODE
AUTH_MODE
Definition: esp_wifi.h:59
espconn_mesh_init
void espconn_mesh_init()
To print version of mesh.
MESH_NODE_ALL
Definition: mesh.h:66
espconn_mesh_get_status
sint8 espconn_mesh_get_status()
Get current mesh status.
mesh_node_type
mesh_node_type
Definition: mesh.h:63
MESH_ONLINE_AVAIL
Definition: mesh.h:60
espconn_mesh_disconnect
sint8 espconn_mesh_disconnect(struct espconn *usr_esp)
Disconnect a mesh connection.
MESH_NET_CONN
Definition: mesh.h:58
espconn_mesh_connect
sint8 espconn_mesh_connect(struct espconn *usr_esp)
Try to establish mesh connection to server.
espconn_mesh_local_addr
bool espconn_mesh_local_addr(struct ip_addr *ip)
Check whether the IP address is mesh local IP address or not.
espconn_mesh_enable
void espconn_mesh_enable(espconn_mesh_callback enable_cb, enum mesh_type type)
To enable mesh network.
espconn_mesh_disable
void espconn_mesh_disable(espconn_mesh_callback disable_cb)
To disable mesh network.
espconn_mesh_get_node_info
bool espconn_mesh_get_node_info(enum mesh_node_type type, uint8_t **info, uint8_t *count)
Get the information of mesh node.
MESH_NODE_CHILD
Definition: mesh.h:65
MESH_DISABLE
Definition: mesh.h:56
espconn_mesh_set_ssid_prefix
bool espconn_mesh_set_ssid_prefix(uint8_t *prefix, uint8_t prefix_len)
Set prefix of SSID for mesh node.
espconn
Definition: espconn.h:150
MESH_LOCAL_AVAIL
Definition: mesh.h:59
espconn_mesh_encrypt_init
bool espconn_mesh_encrypt_init(AUTH_MODE mode, uint8_t *passwd, uint8_t passwd_len)
Set WiFi cryption algrithm and password for mesh node.
mesh_status
mesh_status
Definition: mesh.h:55
MESH_NODE_PARENT
Definition: mesh.h:64
espconn_mesh_sent
sint8 espconn_mesh_sent(struct espconn *usr_esp, uint8 *pdata, uint16 len)
Send data through mesh network.
espconn_mesh_group_id_init
bool espconn_mesh_group_id_init(uint8_t *grp_id, uint16_t gid_len)
Set group ID of mesh node.
espconn_mesh_get_max_hops
uint8 espconn_mesh_get_max_hops()
Get max hop of mesh network.