ESP8266_NONOS_MESH_API
V1.0.0
|
Mesh APIs. More...
Functions | |
void * | espconn_mesh_create_packet (uint8_t *dst_addr, uint8_t *src_addr, bool p2p, bool piggyback_cr, enum mesh_usr_proto_type proto, uint16_t data_len, bool option, uint16_t ot_len, bool frag, enum mesh_option_type frag_type, bool mf, uint16_t frag_idx, uint16_t frag_id) |
The function is used to create mesh packet. More... | |
void * | espconn_mesh_create_option (uint8_t otype, uint8_t *ovalue, uint8_t val_len) |
The function is used to create mesh option. More... | |
bool | espconn_mesh_add_option (struct mesh_header_format *head, struct mesh_header_option_format *option) |
The function is used to add mesh option in mesh packet. More... | |
bool | espconn_mesh_get_option (struct mesh_header_format *head, enum mesh_option_type otype, uint16_t oidx, struct mesh_header_option_format **option) |
The function is used to get mesh option in mesh packet.. More... | |
bool | espconn_mesh_get_usr_data (struct mesh_header_format *head, uint8_t **usr_data, uint16_t *data_len) |
The function is used to get user data in mesh packet.. More... | |
bool | espconn_mesh_set_usr_data (struct mesh_header_format *head, uint8_t *usr_data, uint16_t data_len) |
The function is used to set user data in mesh packet.. More... | |
bool | espconn_mesh_get_src_addr (struct mesh_header_format *head, uint8_t **src_addr) |
The function is used to get source address of mesh packet. More... | |
bool | espconn_mesh_get_dst_addr (struct mesh_header_format *head, uint8_t **dst_addr) |
The function is used to get destination address of mesh packet. More... | |
bool | espconn_mesh_set_src_addr (struct mesh_header_format *head, uint8_t *src_addr) |
The function is used to set source address of mesh packet. More... | |
bool | espconn_mesh_set_dst_addr (struct mesh_header_format *head, uint8_t *dst_addr) |
The function is used to set destination address of mesh packet. More... | |
bool | espconn_mesh_get_usr_data_proto (struct mesh_header_format *head, enum mesh_usr_proto_type *proto) |
The function is used to get protocol used by user data in mesh packet. More... | |
bool | espconn_mesh_set_usr_data_proto (struct mesh_header_format *head, enum mesh_usr_proto_type proto) |
The function is used to set protocol used by user data in mesh packet. More... | |
bool | espconn_mesh_local_addr (struct ip_addr *ip) |
Check whether the IP address is mesh local IP address or not. More... | |
bool | espconn_mesh_get_node_info (enum mesh_node_type type, uint8_t **info, uint16_t *count) |
The function is used to get the information of mesh node.. More... | |
bool | espconn_mesh_get_router (struct station_config *router) |
The function is used to get router AP information used by mesh node. More... | |
bool | espconn_mesh_set_router (struct station_config *router) |
The function is used to set router AP information for mesh node. More... | |
bool | espconn_mesh_encrypt_init (AUTH_MODE mode, uint8_t *passwd, uint8_t pw_len) |
The function is used to init encrypt algorithm and password for mesh AP. More... | |
bool | espconn_mesh_group_id_init (uint8_t *grp_id, uint16_t gid_len) |
The function is used to init group id for mesh node. More... | |
bool | espconn_mesh_regist_conn_ready_cb (espconn_mesh_usr_callback cb) |
The function is used to register user callback. If TCP connection with parent node is ready, mesh will call the user callback.. More... | |
bool | espconn_mesh_regist_usr_cb (espconn_mesh_usr_callback cb) |
The function is used to register user callback. If child node joins parent, parent will trigger the callback to indicate user. More... | |
bool | espconn_mesh_server_init (struct ip_addr *ip, uint16_t port) |
The function is used to set server ip and port for mesh node. More... | |
bool | espconn_mesh_set_max_hops (uint8_t max_hops) |
The function is used to set max_hops for mesh network.. More... | |
bool | espconn_mesh_set_ssid_prefix (uint8_t *prefix, uint8_t prefix_len) |
The function is used to set SSID prefix for mesh AP. More... | |
bool | espconn_mesh_set_scan_retries (uint8_t retries) |
The function is used to set scan retries if no available AP to been found. More... | |
int8_t | espconn_mesh_connect (struct espconn *usr_esp) |
Try to establish mesh connection to server. More... | |
int8_t | espconn_mesh_disconnect (struct espconn *usr_esp) |
Disconnect a mesh connection. More... | |
int8_t | espconn_mesh_get_status () |
The function is used to get current status of mesh node. More... | |
int8_t | espconn_mesh_sent (struct espconn *usr_esp, uint8 *pdata, uint16 len) |
Send data through mesh network. More... | |
uint8_t | espconn_mesh_get_max_hops () |
The function is used to get current max hop of mesh network. More... | |
uint8_t | espconn_mesh_layer (struct ip_addr *ip) |
The function is used to get current max hop of mesh network. More... | |
uint16_t | espconn_mesh_get_sub_dev_count () |
The function is used to get the number of all the sub nodes of current node. More... | |
void | espconn_mesh_enable (espconn_mesh_callback enable_cb, enum mesh_type type) |
To enable mesh network. More... | |
void | espconn_mesh_disable (espconn_mesh_callback disable_cb) |
To disable mesh network. More... | |
void | espconn_mesh_deauth_all () |
The function is used to reject all the child node. More... | |
void | espconn_mesh_disp_route_table () |
The function is used to display route table of current node. More... | |
void | espconn_mesh_print_ver () |
The function is used to print version of mesh. More... | |
void | espconn_mesh_release_congest () |
TThe function is used to discard all the packet to parent. More... | |
void | espconn_mesh_scan (struct mesh_scan_para_type *para) |
The function is used to scan AP around current node. More... | |
void | espconn_mesh_setup_timer (os_timer_t *timer, uint32_t time, os_timer_func_t cb, void *arg, bool repeat) |
The function is used setup timer with callback function. More... | |
Mesh APIs.
bool espconn_mesh_add_option | ( | struct mesh_header_format * | head, |
struct mesh_header_option_format * | option | ||
) |
The function is used to add mesh option in mesh packet.
struct | mesh_header_format *head : mesh packet header |
struct | mesh_header_option_format *option : option |
int8_t espconn_mesh_connect | ( | struct espconn * | usr_esp | ) |
Try to establish mesh connection to server.
struct | espconn *usr_esp : the network connection structure, the usr_esp to listen to the connection |
void* espconn_mesh_create_option | ( | uint8_t | otype, |
uint8_t * | ovalue, | ||
uint8_t | val_len | ||
) |
The function is used to create mesh option.
uint8_t | otype : option type |
uint8_t | *ovalue : option value |
uint8_t | val_len : length of option value |
void* espconn_mesh_create_packet | ( | uint8_t * | dst_addr, |
uint8_t * | src_addr, | ||
bool | p2p, | ||
bool | piggyback_cr, | ||
enum mesh_usr_proto_type | proto, | ||
uint16_t | data_len, | ||
bool | option, | ||
uint16_t | ot_len, | ||
bool | frag, | ||
enum mesh_option_type | frag_type, | ||
bool | mf, | ||
uint16_t | frag_idx, | ||
uint16_t | frag_id | ||
) |
The function is used to create mesh packet.
uint8_t | *dst_addr : destination address (6 Bytes) |
uint8_t | *src_addr : source address (6 Bytes) |
bool | p2p : node-to-node packet |
bool | piggyback_cr : piggyback flow request |
enum | mesh_usr_proto_type proto : protocol used by user data |
uint16_t | data_len : length of user data |
bool | option : option flag |
uint16_t | ot_len : option total length |
bool | frag : fragmentation flag |
enum | mesh_option_type frag_type : fragmentation type |
bool | mf : more fragmentation |
uint16_t | frag_idx : fragmentation index |
uint16_t | frag_id : fragmentation id |
void espconn_mesh_deauth_all | ( | ) |
The function is used to reject all the child node.
null |
void espconn_mesh_disable | ( | espconn_mesh_callback | disable_cb | ) |
To disable mesh network.
espconn_mesh_callback | disable_cb : callback function of mesh-disable |
int8_t espconn_mesh_disconnect | ( | struct espconn * | usr_esp | ) |
Disconnect a mesh connection.
struct | espconn *usr_esp : the network connection structure |
void espconn_mesh_disp_route_table | ( | ) |
The function is used to display route table of current node.
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. |
bool espconn_mesh_encrypt_init | ( | AUTH_MODE | mode, |
uint8_t * | passwd, | ||
uint8_t | pw_len | ||
) |
The function is used to init encrypt algorithm and password for mesh AP.
AUTH_MODE | mode : encrypt algorithm (WPA_PSK, WPA2_PSK, WPA_WPA2_PSK) |
uint8_t | *passwd : password |
uint8_t | pw_len : length of password |
bool espconn_mesh_get_dst_addr | ( | struct mesh_header_format * | head, |
uint8_t ** | dst_addr | ||
) |
The function is used to get destination address of mesh packet.
struct | mesh_header_format *head : mesh packet header |
uint8_t | **dst_addr : destination address |
uint8_t espconn_mesh_get_max_hops | ( | ) |
The function is used to get current max hop of mesh network.
null. |
bool espconn_mesh_get_node_info | ( | enum mesh_node_type | type, |
uint8_t ** | info, | ||
uint16_t * | count | ||
) |
The function is used to get the information of mesh node..
enum | mesh_node_type type : mesh node type |
uint8_t | **info : the information will be saved in *info |
uint16_t | *count : the node count in *inf |
bool espconn_mesh_get_option | ( | struct mesh_header_format * | head, |
enum mesh_option_type | otype, | ||
uint16_t | oidx, | ||
struct mesh_header_option_format ** | option | ||
) |
The function is used to get mesh option in mesh packet..
struct | mesh_header_format *head : mesh packet header |
enum | mesh_option_type otype : option type |
uint16_t | oidx : option index |
struct | mesh_header_option_format **option : option |
bool espconn_mesh_get_router | ( | struct station_config * | router | ) |
The function is used to get router AP information used by mesh node.
struct | station_config *router : if success, the router AP information will be saved in router |
bool espconn_mesh_get_src_addr | ( | struct mesh_header_format * | head, |
uint8_t ** | src_addr | ||
) |
The function is used to get source address of mesh packet.
struct | mesh_header_format *head : mesh packet header |
uint8_t | **src_addr : source address |
int8_t espconn_mesh_get_status | ( | ) |
The function is used to get current status of mesh node.
null |
uint16_t espconn_mesh_get_sub_dev_count | ( | ) |
The function is used to get the number of all the sub nodes of current node.
null. |
bool espconn_mesh_get_usr_data | ( | struct mesh_header_format * | head, |
uint8_t ** | usr_data, | ||
uint16_t * | data_len | ||
) |
The function is used to get user data in mesh packet..
struct | mesh_header_format *head : mesh packet header |
uint8_t | **usr_data : user data |
uint16_t | *data_len : length of user data |
bool espconn_mesh_get_usr_data_proto | ( | struct mesh_header_format * | head, |
enum mesh_usr_proto_type * | proto | ||
) |
The function is used to get protocol used by user data in mesh packet.
struct | mesh_header_format *head : mesh packet header |
enum | mesh_usr_proto_type *proto : protocol of user data |
bool espconn_mesh_group_id_init | ( | uint8_t * | grp_id, |
uint16_t | gid_len | ||
) |
The function is used to init group id for mesh node.
uint8_t | *grp_id : group id |
uint16_t | gid_len : length of group id |
uint8_t espconn_mesh_layer | ( | struct ip_addr * | ip | ) |
The function is used to get current max hop of mesh network.
struct | ip_addr *ip : IP address |
bool espconn_mesh_local_addr | ( | struct ip_addr * | ip | ) |
Check whether the IP address is mesh local IP address or not.
struct | ip_addr *ip : IP address |
void espconn_mesh_print_ver | ( | ) |
The function is used to print version of mesh.
null. |
bool espconn_mesh_regist_conn_ready_cb | ( | espconn_mesh_usr_callback | cb | ) |
The function is used to register user callback. If TCP connection with parent node is ready, mesh will call the user callback..
espconn_mesh_usr_callback | cb : user callback function |
bool espconn_mesh_regist_usr_cb | ( | espconn_mesh_usr_callback | cb | ) |
The function is used to register user callback. If child node joins parent, parent will trigger the callback to indicate user.
/**
espconn_mesh_usr_callback | cb : user callback function |
void espconn_mesh_release_congest | ( | ) |
TThe function is used to discard all the packet to parent.
null. |
void espconn_mesh_scan | ( | struct mesh_scan_para_type * | para | ) |
The function is used to scan AP around current node.
struct | mesh_scan_para_type *para : parameter of scan |
int8_t espconn_mesh_sent | ( | struct espconn * | usr_esp, |
uint8 * | pdata, | ||
uint16 | len | ||
) |
Send data through mesh network.
struct | espconn *usr_esp : the network connection structure |
uint8 | *pdata : pointer of data |
uint16 | len : data length |
bool espconn_mesh_server_init | ( | struct ip_addr * | ip, |
uint16_t | port | ||
) |
The function is used to set server ip and port for mesh node.
struct | ip_addr *ip : IP address |
uint16_t | port : port |
bool espconn_mesh_set_dst_addr | ( | struct mesh_header_format * | head, |
uint8_t * | dst_addr | ||
) |
The function is used to set destination address of mesh packet.
struct | mesh_header_format *head : mesh packet header |
uint8_t | *dst_addr : destination address |
bool espconn_mesh_set_max_hops | ( | uint8_t | max_hops | ) |
The function is used to set max_hops for mesh network..
uint8_t | max_hops : max hops of mesh network |
bool espconn_mesh_set_router | ( | struct station_config * | router | ) |
The function is used to set router AP information for mesh node.
struct | station_config *router : router AP information (ssid, password, bssid (optional)) |
bool espconn_mesh_set_scan_retries | ( | uint8_t | retries | ) |
The function is used to set scan retries if no available AP to been found.
uint8_t | retries : scan retry count |
bool espconn_mesh_set_src_addr | ( | struct mesh_header_format * | head, |
uint8_t * | src_addr | ||
) |
The function is used to set source address of mesh packet.
struct | mesh_header_format *head : mesh packet header |
uint8_t | *src_addr : source address |
bool espconn_mesh_set_ssid_prefix | ( | uint8_t * | prefix, |
uint8_t | prefix_len | ||
) |
The function is used to set SSID prefix for mesh AP.
uint8_t | *prefix : prefix of SSID |
uint8_t | prefix_len : length of prefix |
bool espconn_mesh_set_usr_data | ( | struct mesh_header_format * | head, |
uint8_t * | usr_data, | ||
uint16_t | data_len | ||
) |
The function is used to set user data in mesh packet..
struct | mesh_header_format *head : mesh packet header |
uint8_t | *usr_data : user data |
uint16_t | data_len : length of user data |
bool espconn_mesh_set_usr_data_proto | ( | struct mesh_header_format * | head, |
enum mesh_usr_proto_type | proto | ||
) |
The function is used to set protocol used by user data in mesh packet.
struct | mesh_header_format *head : mesh packet header |
enum | mesh_usr_proto_type proto : protocol of user data |
void espconn_mesh_setup_timer | ( | os_timer_t * | timer, |
uint32_t | time, | ||
os_timer_func_t | cb, | ||
void * | arg, | ||
bool | repeat | ||
) |
The function is used setup timer with callback function.
os_timer_t | *timer : timer |
uint32_t | time: timeout time |
os_timer_func_t | cb : callback function |
void | *arg : argment |
bool | repeat: repeat flag |