Network Interface#

Functions#

sl_status_t
sl_net_init(sl_net_interface_t interface, const void *configuration, void *context, sl_net_event_handler_t event_handler)

Initialize a network interface.

sl_status_t
sl_net_deinit(sl_net_interface_t interface, void *context)

De-initialize a network interface.

sl_status_t
sl_net_up(sl_net_interface_t interface, sl_net_profile_id_t profile_id)

Bring a network interface up.

sl_status_t
sl_net_down(sl_net_interface_t interface)

Bring a network interface down.

sl_status_t
sl_dns_host_get_by_name(const char *host_name, const uint32_t timeout, const sl_net_dns_resolution_ip_type_t dns_resolution_ip, sl_ip_address_t *ip_address)

Resolve given host name to IP address.

Function Documentation#

sl_net_init#

sl_status_t sl_net_init (sl_net_interface_t interface, const void * configuration, void * context, sl_net_event_handler_t event_handler)

Initialize a network interface.

Parameters
TypeDirectionArgument NameDescription
sl_net_interface_t[in]interface

Interface identified by sl_net_interface_t

const void *[in]configuration

Configuration object specific to network interface.

void *[in]context

Runtime context specific to network interface.

sl_net_event_handler_t[in]event_handler

Processes all events related to network interface.

This API should be called before calling any sl_net API. Returns


sl_net_deinit#

sl_status_t sl_net_deinit (sl_net_interface_t interface, void * context)

De-initialize a network interface.

Parameters
TypeDirectionArgument NameDescription
sl_net_interface_t[in]interface

Interface identified by sl_net_interface_t

void *[in]context

Runtime context specific to network interface.

Returns


sl_net_up#

sl_status_t sl_net_up (sl_net_interface_t interface, sl_net_profile_id_t profile_id)

Bring a network interface up.

Parameters
TypeDirectionArgument NameDescription
sl_net_interface_t[in]interface

Interface identified by sl_net_interface_t

sl_net_profile_id_t[in]profile_id

SL Network profile identifier for specific interface.

Returns


sl_net_down#

sl_status_t sl_net_down (sl_net_interface_t interface)

Bring a network interface down.

Parameters
TypeDirectionArgument NameDescription
sl_net_interface_t[in]interface

Interface identified by sl_net_interface_t

Returns


sl_dns_host_get_by_name#

sl_status_t sl_dns_host_get_by_name (const char * host_name, const uint32_t timeout, const sl_net_dns_resolution_ip_type_t dns_resolution_ip, sl_ip_address_t * ip_address)

Resolve given host name to IP address.

Parameters
TypeDirectionArgument NameDescription
const char *N/Ahost_name

Host name which needs to be resolved.

const uint32_tN/Atimeout

If value is greater than zero, caller would be blocked till timeout milliseconds to get the response. If the values is equal's to zero, response would sent asynchronously using callbacks.

const sl_net_dns_resolution_ip_type_tN/Adns_resolution_ip

Whether the host name needs to be resolved to IPV4 or IPV6.

sl_ip_address_t *N/Aip_address

IP address object to store resolved IP address

Returns