ESP8266 Centre + NB
|
Mesh APIs. 更多...
结构体 | |
struct | mesh_scan_para_type |
枚举 | |
enum | mesh_status { MESH_DISABLE = 0, MESH_WIFI_CONN, MESH_NET_CONN, MESH_LOCAL_AVAIL, MESH_ONLINE_AVAIL } |
enum | mesh_node_type { MESH_NODE_PARENT = 0, MESH_NODE_CHILD, MESH_NODE_ALL } |
函数 | |
bool | espconn_mesh_local_addr (struct ip_addr *ip) |
Check whether the IP address is mesh local IP address or not. 更多... | |
bool | espconn_mesh_get_router (struct station_config *router) |
Get the information of router used by mesh network. 更多... | |
bool | espconn_mesh_set_router (struct station_config *router) |
Set the information of router used by mesh network. 更多... | |
bool | espconn_mesh_server_init (struct ip_addr *ip, uint16_t port) |
Set server setup by user. 更多... | |
bool | espconn_mesh_get_node_info (enum mesh_node_type type, uint8_t **info, uint8_t *count) |
Get the information of mesh node. 更多... | |
bool | espconn_mesh_encrypt_init (AUTH_MODE mode, uint8_t *passwd, uint8_t passwd_len) |
Set WiFi cryption algrithm and password for mesh node. 更多... | |
bool | espconn_mesh_set_ssid_prefix (uint8_t *prefix, uint8_t prefix_len) |
Set prefix of SSID for mesh node. 更多... | |
bool | espconn_mesh_set_max_hops (uint8_t max_hops) |
Set max hop for mesh network. 更多... | |
bool | espconn_mesh_group_id_init (uint8_t *grp_id, uint16_t gid_len) |
Set group ID of mesh node. 更多... | |
bool | espconn_mesh_set_dev_type (uint8_t dev_type) |
Set the curent device type. 更多... | |
uint8_t | espconn_mesh_get_dev_type () |
Get the curent device type. 更多... | |
int8_t | espconn_mesh_connect (struct espconn *usr_esp) |
Try to establish mesh connection to server. 更多... | |
int8_t | espconn_mesh_disconnect (struct espconn *usr_esp) |
Disconnect a mesh connection. 更多... | |
int8_t | espconn_mesh_get_status () |
Get current mesh status. 更多... | |
int8_t | espconn_mesh_sent (struct espconn *usr_esp, uint8 *pdata, uint16 len) |
Send data through mesh network. 更多... | |
uint8_t | espconn_mesh_get_max_hops () |
Get max hop of mesh network. 更多... | |
void | espconn_mesh_enable (espconn_mesh_callback enable_cb, enum mesh_type type) |
To enable mesh network. 更多... | |
void | espconn_mesh_disable (espconn_mesh_callback disable_cb) |
To disable mesh network. 更多... | |
void | espconn_mesh_print_ver () |
To print version of mesh. 更多... | |
void | espconn_mesh_scan (struct mesh_scan_para_type *para) |
To get AP around node. 更多... | |
Mesh APIs.
enum mesh_status |
enum mesh_node_type |
Check whether the IP address is mesh local IP address or not.
struct | ip_addr *ip : IP address |
bool espconn_mesh_get_router | ( | struct station_config * | router | ) |
Get the information of router used by mesh network.
struct | station_config *router: router inforamtion |
bool espconn_mesh_set_router | ( | struct station_config * | router | ) |
Set the information of router used by mesh network.
struct | station_config *router: router information. user should initialize the ssid and password. |
Set server setup by user.
struct | ip_addr *ip : ip address of server. |
uint16_t | port : port used by server. |
bool espconn_mesh_get_node_info | ( | enum mesh_node_type | type, |
uint8_t ** | info, | ||
uint8_t * | count | ||
) |
Get the information of mesh node.
enum | mesh_node_type typ : mesh node type. |
uint8_t | **info : the information will be saved in *info. |
uint8_t | *count : the node count in *info. |
Set WiFi cryption algrithm and password for mesh node.
AUTH_MODE | mode : cryption algrithm (WPA/WAP2/WPA_WPA2). |
uint8_t | *passwd : password of WiFi. |
uint8_t | passwd_len : length of password (8 <= passwd_len <= 64). |
Set prefix of SSID for mesh node.
uint8_t | *prefix : prefix of SSID. |
uint8_t | prefix_len : length of prefix (0 < passwd_len <= 22). |
Set max hop for mesh network.
uint8_t | max_hops : max hop of mesh network (1 <= max_hops < 10, 4 is recommended). |
Set group ID of mesh node.
uint8_t | *grp_id : group ID. |
uint16_t | gid_len: length of group ID, now gid_len = 6. |
Set the curent device type.
uint8_t | dev_type : device type of mesh node |
uint8_t espconn_mesh_get_dev_type | ( | ) |
Get the curent device type.
none |
Try to establish mesh connection to server.
struct | espconn *usr_esp : the network connection structure, the usr_esp to listen to the connection |
Disconnect a mesh connection.
struct | espconn *usr_esp : the network connection structure |
int8_t espconn_mesh_get_status | ( | ) |
Get current mesh status.
null |
Send data through mesh network.
struct | espconn *usr_esp : the network connection structure |
uint8 | *pdata : pointer of data |
uint16 | len : data length |
uint8_t espconn_mesh_get_max_hops | ( | ) |
Get max hop of mesh network.
null. |
void espconn_mesh_enable | ( | espconn_mesh_callback | enable_cb, |
enum mesh_type | type | ||
) |
To enable mesh network.
espconn_mesh_callback | enable_cb : callback function of mesh-enable |
enum | mesh_type type : type of mesh, local or online. |
void espconn_mesh_disable | ( | espconn_mesh_callback | disable_cb | ) |
To disable mesh network.
espconn_mesh_callback | disable_cb : callback function of mesh-disable |
enum | mesh_type type : type of mesh, local or online. |
void espconn_mesh_print_ver | ( | ) |
To print version of mesh.
null |
void espconn_mesh_scan | ( | struct mesh_scan_para_type * | para | ) |
To get AP around node.
struct | mesh_scan_para_type *para : callback function of mesh-disable |