Interface

Functions for starting/stop WLAN & SoftAP interfaces. More...

Modules

Types
Network Interface Types.
 
Macros
Network interface specific macros.
 

Functions

zos_result_t zn_network_up (zos_interface_t interface, zos_bool_t block)
 Bring network interface up. More...
 
zos_result_t zn_network_down (zos_interface_t interface)
 Bring network interface down. More...
 
zos_result_t zn_network_restart (zos_interface_t interface)
 Restart network interface. More...
 
zos_bool_t zn_network_is_up (zos_interface_t interface)
 Return status of network interface. More...
 
zos_result_t zn_network_close_all_streams (zos_interface_t interface)
 Close all data streams on specified network interface. More...
 
zos_result_t zn_network_softap_client_list (zos_softap_client_t *client_list, uint32_t *client_count)
 Return list of SoftAP clients. More...
 
zos_result_t zn_network_softap_deauth_client (zos_mac_t *mac, zos_deauth_reason_t reason)
 Deauthenticate SoftAP client. More...
 
zos_result_t zn_network_register_event_handler (zos_interface_t interface, zos_network_event_handler_t handler)
 Register network event handler. More...
 
zos_result_t zn_network_register_softap_event_handler (zos_softap_event_handler_t handler)
 Register SoftAP client event handler. More...
 

Detailed Description

Functions for starting/stop WLAN & SoftAP interfaces.

Function Documentation

zos_result_t zn_network_close_all_streams ( zos_interface_t  interface)

Close all data streams on specified network interface.

Parameters
[in]interfacezos_interface_t the interface to close all streams on
Returns
zos_result_t result of api call
Examples:
basic/tcp_client/tcp_client.c, basic/udp_client/udp_client.c, basic/udp_hello_gpio/udp_hello_gpio.c, and basic/websocket_client/websocket_client.c.
zos_result_t zn_network_down ( zos_interface_t  interface)

Bring network interface down.

See ZentriOS Command API documentation: network_down.

Parameters
[in]interfacezos_interface_t the interface to bring down
Returns
zos_result_t result of api call
Examples:
demo/pong/link_client.c, and demo/pong/link_server.c.
zos_bool_t zn_network_is_up ( zos_interface_t  interface)

Return status of network interface.

Parameters
[in]interfacezos_interface_t the interface to check status of
Returns
ZOS_TRUE is network interface is up, ZOS_FALSE else
Examples:
basic/ftp_upload/ftp_upload.c, basic/tcp_client/tcp_client.c, and cloud/mqttdemo/main.c.
zos_result_t zn_network_register_event_handler ( zos_interface_t  interface,
zos_network_event_handler_t  handler 
)

Register network event handler.

Note
The event handler executes in the Zap thread context
Parameters
[in]interfacezos_interface_t the interface to register handler with
[in]handlerzos_network_event_handler_t to be called on network interface event
Returns
zos_result_t result of api call
zos_result_t zn_network_register_softap_event_handler ( zos_softap_event_handler_t  handler)

Register SoftAP client event handler.

Note
The event handler executes in the Zap thread context
Parameters
[in]handlerzos_softap_event_handler_t to be called on softap client event
Returns
zos_result_t result of api call
Examples:
basic/softap_tcp_server/softap_tcp_server.c, and nxp/nfc3d/local.c.
zos_result_t zn_network_softap_client_list ( zos_softap_client_t client_list,
uint32_t *  client_count 
)

Return list of SoftAP clients.

The supplied client_list argument should be a buffer large enough to hold all associated clients. e.g.

zos_softap_client_t client_list[ZOS_MAX_SOFTAP_CLIENTS];

Parameters
[out]client_listBuffer containing list of associated client's information
[out]client_countPointer to hold number of client's associated, leave NULL if unused
Returns
zos_result_t result of api call
Examples:
nxp/nfc3d/cloud_rest.c, and nxp/nfc3d/cloud_websocket.c.
zos_result_t zn_network_softap_deauth_client ( zos_mac_t mac,
zos_deauth_reason_t  reason 
)

Deauthenticate SoftAP client.

This boots a softap client of the softap network.

Parameters
[in]macMAC address of SoftAP client
[in]reasonReason for deauthenticating client, see zos_deauth_reason_t
Returns
zos_result_t result of api call
zos_result_t zn_network_up ( zos_interface_t  interface,
zos_bool_t  block 
)

Bring network interface up.

See ZentriOS Command API documentation: network_up.

Parameters
[in]interfacezos_interface_t the interface to bring up
[in]blockZOS_TRUE if API call should block until interface is brought up, ZOS_FALSE if it should return immediately
Returns
zos_result_t result of api call
Examples:
basic/softap_tcp_server/softap_tcp_server.c, basic/udp_client/udp_client.c, basic/websocket_client/websocket_client.c, cloud/simplemq/main.c, demo/pong/link_server.c, nxp/nfc3d/cloud_rest.c, and nxp/nfc3d/cloud_websocket.c.