Example App Utilities

Utilities for SDK example apps. More...

Functions

gos_result_t example_app_util_network_up ( gos_interface_t interface, bool restart, gos_network_handler_t network_event_handler)
const char * example_app_util_get_network_interface_ip_address_str (void)

Detailed Description

Utilities for SDK example apps.

Function Documentation

example_app_util_get_network_interface_ip_address_str()

const char* example_app_util_get_network_interface_ip_address_str ( void )

Return the IP address of the default network interface as a string

Returns
IP address as string of default network interface
Examples:
hurricane/arducam/network.c , network/tcp_echo_server/main.c , network/tcp_multiclient/main.c , and network/websocket_server/main.c .

example_app_util_network_up()

gos_result_t example_app_util_network_up ( gos_interface_t interface,
bool restart,
gos_network_handler_t network_event_handler
)

Attempt to bring the specified network interface up.

If interface is GOS_INTERFACE_ANY first try to bringup the default interface. If that fails, try to bringup the GOS_INTERFACE_ETHERNET interface if it's not the default interface AND the platform supports the GOS_INTERFACE_ETHERNET . Else try to bringup the GOS_INTERFACE_WLAN .

Print a meaningful error message on failure.

Parameters
[in] interface gos_interface_t to bring up
[in] restart If true then restart the interface if it's already up, if false then only bring it up if it's currently down
[in] network_event_handler gos_network_handler_t to be invoke when the network state changes
Returns
gos_result_t , the result of the API
Examples:
cloud/dps_demo/main.c , cloud/mqtt_demo/main.c , demo/secure_element/main.c , dms/messages/main.c , dms/ota_update/main.c , dms/telemetry/main.c , hurricane/arducam/network.c , network/http_methods/main.c , network/http_server/main.c , network/http_server_stream/main.c , network/https_server/main.c , network/tcp_client/main.c , network/tcp_echo_server/main.c , network/tcp_multiclient/main.c , network/uart_tcp_client/main.c , network/udp_client/main.c , network/udp_hello_gpio/main.c , network/websocket_client/main.c , network/websocket_cmd_stream/main.c , network/websocket_server/main.c , system/indicator/main.c , utility/msgpack/main.c , and utility/profiler/main.c .