Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions

API that should be used to manage device connections. More...

Data Structures

struct  sol_netctl_agent
 agent callback functions More...
 
struct  sol_netctl_agent_input
 agent input struct More...
 
struct  sol_netctl_ethernet
 struct to represent a network ethernet. More...
 
struct  sol_netctl_network_params
 network params More...
 
struct  sol_netctl_provider
 struct to represent a network provider. More...
 
struct  sol_netctl_proxy
 struct to represent a network proxy. More...
 

Macros

#define SOL_NETCTL_AGENT_IDENTITY   "Identity"
 the agent input identity type string More...
 
#define SOL_NETCTL_AGENT_NAME   "Name"
 the agent input name type string More...
 
#define SOL_NETCTL_AGENT_PASSPHRASE   "Passphrase"
 the agent input passphrase type string More...
 
#define SOL_NETCTL_AGENT_PASSWORD   "Password"
 the agent input password type string More...
 
#define SOL_NETCTL_AGENT_USERNAME   "Username"
 the agent input username type string More...
 
#define SOL_NETCTL_AGENT_WPS   "WPS"
 the agent input WPS type string More...
 
#define SOL_NETCTL_SERVICE_TYPE_BLUETOOTH   "bluetooth"
 bluetooth service type string More...
 
#define SOL_NETCTL_SERVICE_TYPE_CELLULAR   "cellular"
 bluetooth service type string More...
 
#define SOL_NETCTL_SERVICE_TYPE_ETHERNET   "ethernet"
 ethernet service type string More...
 
#define SOL_NETCTL_SERVICE_TYPE_GADGET   "gadget"
 gadget service type string More...
 
#define SOL_NETCTL_SERVICE_TYPE_GPS   "gps"
 gps service type string More...
 
#define SOL_NETCTL_SERVICE_TYPE_P2P   "p2p"
 p2p service type string More...
 
#define SOL_NETCTL_SERVICE_TYPE_VPN   "vpn"
 vpn service type string More...
 
#define SOL_NETCTL_SERVICE_TYPE_WIFI   "wifi"
 wifi service type string More...
 

Typedefs

typedef struct sol_netctl_agent sol_netctl_agent
 agent callback functions More...
 
typedef struct
sol_netctl_agent_input 
sol_netctl_agent_input
 agent input struct More...
 
typedef void(* sol_netctl_error_monitor_cb )(void *data, const struct sol_netctl_service *service, unsigned int error)
 error monitor callback used to inform a call result More...
 
typedef struct sol_netctl_ethernet sol_netctl_ethernet
 struct to represent a network ethernet. More...
 
typedef void(* sol_netctl_manager_monitor_cb )(void *data)
 Manager monitor callback used to inform a manager updated. More...
 
typedef struct
sol_netctl_network_params 
sol_netctl_network_params
 network params More...
 
typedef struct sol_netctl_provider sol_netctl_provider
 struct to represent a network provider. More...
 
typedef struct sol_netctl_proxy sol_netctl_proxy
 struct to represent a network proxy. More...
 
typedef struct sol_netctl_service sol_netctl_service
 service struct More...
 
typedef void(* sol_netctl_service_monitor_cb )(void *data, const struct sol_netctl_service *service)
 Service monitor callback used to inform a service changed. More...
 

Enumerations

enum  sol_netctl_proxy_method { SOL_NETCTL_PROXY_METHOD_DIRECT, SOL_NETCTL_PROXY_METHOD_AUTO, SOL_NETCTL_PROXY_METHOD_MANUAL }
 method of proxy generated for a network link. More...
 
enum  sol_netctl_service_state {
  SOL_NETCTL_SERVICE_STATE_UNKNOWN = 0, SOL_NETCTL_SERVICE_STATE_IDLE, SOL_NETCTL_SERVICE_STATE_ASSOCIATION, SOL_NETCTL_SERVICE_STATE_CONFIGURATION,
  SOL_NETCTL_SERVICE_STATE_READY, SOL_NETCTL_SERVICE_STATE_ONLINE, SOL_NETCTL_SERVICE_STATE_DISCONNECT, SOL_NETCTL_SERVICE_STATE_FAILURE,
  SOL_NETCTL_SERVICE_STATE_REMOVE
}
 service state More...
 
enum  sol_netctl_state {
  SOL_NETCTL_STATE_UNKNOWN = 0, SOL_NETCTL_STATE_IDLE, SOL_NETCTL_STATE_READY, SOL_NETCTL_STATE_ONLINE,
  SOL_NETCTL_STATE_OFFLINE
}
 the global connection state of system More...
 

Functions

int sol_netctl_add_error_monitor (sol_netctl_error_monitor_cb cb, const void *data)
 Adds a monitor for the call error happens. More...
 
int sol_netctl_add_manager_monitor (sol_netctl_manager_monitor_cb cb, const void *data)
 Adds a monitor for the updated netctl manager properties. More...
 
int sol_netctl_add_service_monitor (sol_netctl_service_monitor_cb cb, const void *data)
 Adds a monitor for the updated netctl services. More...
 
int sol_netctl_del_error_monitor (sol_netctl_error_monitor_cb cb, const void *data)
 Dels a monitor for the call error happens. More...
 
int sol_netctl_del_manager_monitor (sol_netctl_manager_monitor_cb cb, const void *data)
 Dels a monitor for the updated netctl manager properties. More...
 
int sol_netctl_del_service_monitor (sol_netctl_service_monitor_cb cb, const void *data)
 Dels a monitor for the updated netctl services. More...
 
static struct sol_netctl_servicesol_netctl_find_service_by_name (const char *service_name)
 get so_netctl_service struct from serivce name. More...
 
bool sol_netctl_get_radios_offline (void)
 Gets the global connection state of offline. More...
 
const struct sol_ptr_vectorsol_netctl_get_services (void)
 Gets the netctl services. More...
 
enum sol_netctl_state sol_netctl_get_state (void)
 Gets the global connection state of system. More...
 
int sol_netctl_register_agent (const struct sol_netctl_agent *agent, const void *data)
 register a agent for network connection More...
 
int sol_netctl_request_input (struct sol_netctl_service *service, const struct sol_ptr_vector *inputs)
 request the login input to connection More...
 
int sol_netctl_request_retry (struct sol_netctl_service *service, bool retry)
 request retry the connection or not when error type is reported More...
 
int sol_netctl_scan (void)
 request scan the surrounding devices More...
 
int sol_netctl_service_connect (struct sol_netctl_service *service)
 Connect the service. More...
 
int sol_netctl_service_disconnect (struct sol_netctl_service *service)
 Disconnect the service. More...
 
const struct sol_ptr_vectorsol_netctl_service_get_domains (const struct sol_netctl_service *service)
 Gets the service domains. More...
 
const char * sol_netctl_service_get_error (const struct sol_netctl_service *service)
 Gets the service error. More...
 
const struct sol_netctl_ethernetsol_netctl_service_get_ethernet (const struct sol_netctl_service *service)
 Gets the service ethernet. More...
 
const char * sol_netctl_service_get_name (const struct sol_netctl_service *service)
 Gets the service name. More...
 
const struct sol_ptr_vectorsol_netctl_service_get_nameservers (const struct sol_netctl_service *service)
 Gets the service nameservers. More...
 
int sol_netctl_service_get_network_address (const struct sol_netctl_service *service, struct sol_network_link **link)
 Gets the service network address. More...
 
const struct sol_netctl_providersol_netctl_service_get_provider (const struct sol_netctl_service *service)
 Gets the service provider. More...
 
const struct sol_netctl_proxysol_netctl_service_get_proxy (const struct sol_netctl_service *service)
 Gets the service proxy. More...
 
const struct sol_ptr_vectorsol_netctl_service_get_security (const struct sol_netctl_service *service)
 Gets the service security methods. More...
 
enum sol_netctl_service_state sol_netctl_service_get_state (const struct sol_netctl_service *service)
 Gets the service state. More...
 
int32_t sol_netctl_service_get_strength (const struct sol_netctl_service *service)
 Gets the service strength. More...
 
const struct sol_ptr_vectorsol_netctl_service_get_timeservers (const struct sol_netctl_service *service)
 Gets the service timeservers. More...
 
const char * sol_netctl_service_get_type (const struct sol_netctl_service *service)
 Gets the service type. More...
 
bool sol_netctl_service_is_autoconnect (const struct sol_netctl_service *service)
 Checks whether the service is autoconnect or not. More...
 
bool sol_netctl_service_is_favorite (const struct sol_netctl_service *service)
 Checks whether the service is favorite or not. More...
 
bool sol_netctl_service_is_immutable (const struct sol_netctl_service *service)
 Checks whether the service is immutable or not. More...
 
bool sol_netctl_service_is_roaming (const struct sol_netctl_service *service)
 Checks whether the service is roaming or not. More...
 
enum sol_netctl_service_state sol_netctl_service_state_from_str (const char *state)
 Converts a string service state to sol_netctl_service_state. More...
 
const char * sol_netctl_service_state_to_str (enum sol_netctl_service_state state)
 Converts sol_netctl_service_state to a string name. More...
 
int sol_netctl_set_radios_offline (bool enabled)
 Sets the global connection state to offline. More...
 
int sol_netctl_unregister_agent (void)
 unregister a agent for network connection More...
 

Detailed Description

API that should be used to manage device connections.

Warning
Experimental API. Changes are expected in future releases.

Macro Definition Documentation

#define SOL_NETCTL_AGENT_IDENTITY   "Identity"

the agent input identity type string

#define SOL_NETCTL_AGENT_NAME   "Name"

the agent input name type string

#define SOL_NETCTL_AGENT_PASSPHRASE   "Passphrase"

the agent input passphrase type string

#define SOL_NETCTL_AGENT_PASSWORD   "Password"

the agent input password type string

#define SOL_NETCTL_AGENT_USERNAME   "Username"

the agent input username type string

#define SOL_NETCTL_AGENT_WPS   "WPS"

the agent input WPS type string

#define SOL_NETCTL_SERVICE_TYPE_BLUETOOTH   "bluetooth"

bluetooth service type string

#define SOL_NETCTL_SERVICE_TYPE_CELLULAR   "cellular"

bluetooth service type string

#define SOL_NETCTL_SERVICE_TYPE_ETHERNET   "ethernet"

ethernet service type string

#define SOL_NETCTL_SERVICE_TYPE_GADGET   "gadget"

gadget service type string

#define SOL_NETCTL_SERVICE_TYPE_GPS   "gps"

gps service type string

#define SOL_NETCTL_SERVICE_TYPE_P2P   "p2p"

p2p service type string

#define SOL_NETCTL_SERVICE_TYPE_VPN   "vpn"

vpn service type string

#define SOL_NETCTL_SERVICE_TYPE_WIFI   "wifi"

wifi service type string

Typedef Documentation

agent callback functions

This struct contains the callback functions of agent.

agent input struct

This struct contains the information of agent input.

typedef void(* sol_netctl_error_monitor_cb)(void *data, const struct sol_netctl_service *service, unsigned int error)

error monitor callback used to inform a call result

Parameters
datathe user data
servicethe activity service
errorthe call result

struct to represent a network ethernet.

This struct contains the necessary information to present a network ethernet for user.

typedef void(* sol_netctl_manager_monitor_cb)(void *data)

Manager monitor callback used to inform a manager updated.

Parameters
datathe user data

network params

This struct contains the information of a network. it has the addr of network link addr, the network of netmask and its gateway of network.

struct to represent a network provider.

This struct contains the necessary information to present a network provider for user.

struct to represent a network proxy.

This struct contains the necessary information to present a network proxy for user.

service struct

typedef void(* sol_netctl_service_monitor_cb)(void *data, const struct sol_netctl_service *service)

Service monitor callback used to inform a service changed.

Parameters
datathe user data
servicethe monitor service

Enumeration Type Documentation

method of proxy generated for a network link.

Enumerator
SOL_NETCTL_PROXY_METHOD_DIRECT 
SOL_NETCTL_PROXY_METHOD_AUTO 
SOL_NETCTL_PROXY_METHOD_MANUAL 

service state

One of these must be chosen to set the state of service, with sol_netctl_service_get_state()

Note
SOL_NETCTL_SERVICE_STATE_REMOVE is used to show the service has been removed. When it is notified, the service has been removed in the system.
Enumerator
SOL_NETCTL_SERVICE_STATE_UNKNOWN 
SOL_NETCTL_SERVICE_STATE_IDLE 
SOL_NETCTL_SERVICE_STATE_ASSOCIATION 
SOL_NETCTL_SERVICE_STATE_CONFIGURATION 
SOL_NETCTL_SERVICE_STATE_READY 
SOL_NETCTL_SERVICE_STATE_ONLINE 
SOL_NETCTL_SERVICE_STATE_DISCONNECT 
SOL_NETCTL_SERVICE_STATE_FAILURE 
SOL_NETCTL_SERVICE_STATE_REMOVE 

the global connection state of system

One of these must be chosen for the global connection state, with sol_netctl_get_state()

Enumerator
SOL_NETCTL_STATE_UNKNOWN 
SOL_NETCTL_STATE_IDLE 
SOL_NETCTL_STATE_READY 
SOL_NETCTL_STATE_ONLINE 
SOL_NETCTL_STATE_OFFLINE 

Function Documentation

int sol_netctl_add_error_monitor ( sol_netctl_error_monitor_cb  cb,
const void *  data 
)

Adds a monitor for the call error happens.

To monitor the call error happens, a single monitor can be done for error happens, and then the call result can be get. sol_netctl_add_error_monitor will call trigger all required activations. This callback must be added BEFORE sol_netctl_service_connect and sol_netctl_service_disconnect.

Parameters
cbmonitor Callback to be called when the call result are updated
dataAdd a user data per callback
Returns
0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by startup().

int sol_netctl_add_manager_monitor ( sol_netctl_manager_monitor_cb  cb,
const void *  data 
)

Adds a monitor for the updated netctl manager properties.

To monitor (State, Offline...), a single monitor can be done for "something changed", and then the new value can be get. sol_netctl_add_manager_monitor will trigger all required activations. This callback must be added BEFORE sol_netctl_get_state and sol_netctl_get_radios_offline.

Parameters
cbmonitor Callback to be called when the manager are updated
dataAdd a user data per callback
Returns
1 on the first time success, 0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by startup().

int sol_netctl_add_service_monitor ( sol_netctl_service_monitor_cb  cb,
const void *  data 
)

Adds a monitor for the updated netctl services.

To monitor the property of services, it gives information about the services. The callback is used to provide the information. sol_netctl_add_service_monitor will trigger all required activations. This callback must be added BEFORE the all functions are called to ensure connection manager has been initialized.

Parameters
cbmonitor Callback to be called when the services are updated
dataAdd a user data per callback
Returns
1 on the first time success, 0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by startup().

int sol_netctl_del_error_monitor ( sol_netctl_error_monitor_cb  cb,
const void *  data 
)

Dels a monitor for the call error happens.

Removes the monitor for updated the call error happens. sol_netctl_del_error_monitor will trigger all required activations.

Parameters
cbmonitor Callback to be called when the call result are updated
dataAdd a user data per callback
Returns
0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by shutdown().

int sol_netctl_del_manager_monitor ( sol_netctl_manager_monitor_cb  cb,
const void *  data 
)

Dels a monitor for the updated netctl manager properties.

Removes the monitor for updated netctl manager properties. sol_netctl_del_manager_monitor will trigger all required activations.

Parameters
cbmonitor Callback to be called when the manager are updated
dataAdd a user data per callback
Returns
0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by shutdown().

int sol_netctl_del_service_monitor ( sol_netctl_service_monitor_cb  cb,
const void *  data 
)

Dels a monitor for the updated netctl services.

Removes the monitor for updated netctl services. sol_netctl_del_service_monitor will trigger all required activations. This callback must be added AFTER the all functions are called to ensure connection manager has been shutdown.

Parameters
cbmonitor Callback to be called when the services are updated
dataAdd a user data per callback
Returns
0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by shutdown().

static struct sol_netctl_service* sol_netctl_find_service_by_name ( const char *  service_name)
static

get so_netctl_service struct from serivce name.

This function return sol_netctl_service struct by a string service name.

See Also
sol_netctl_find_service_by_name.
Parameters
service_namePointer to service name
Returns
data struct of the sol_netctl_service.

References sol_netctl_get_services(), sol_netctl_service_get_name(), and SOL_PTR_VECTOR_FOREACH_IDX.

bool sol_netctl_get_radios_offline ( void  )

Gets the global connection state of offline.

This function gets the global connection state of offline, after the state is to give by manager monitor. This callback of sol_netctl_add_manager_monitor must be added BEFORE sol_netctl_get_radios_offline() is called to ensure no messages are lost.

Returns
true if the offline is enabled, otherwise false.
Examples:
/src/samples/network/netctl.c.

Referenced by manager_cb().

const struct sol_ptr_vector* sol_netctl_get_services ( void  )

Gets the netctl services.

The netctl services vector can be given via sol_netctl_get_services. The vector is the last-known and more may be added/removed dynamically, then the pattern is to add a service monitor BEFORE calling the function.

Returns
The retrieved content on success, NULL on failure.

Referenced by sol_netctl_find_service_by_name().

enum sol_netctl_state sol_netctl_get_state ( void  )

Gets the global connection state of system.

This function gets the global connection state for system, after the state is to give by manager monitor. This callback of sol_netctl_add_manager_monitor must be added BEFORE sol_netctl_get_state() is called to ensure no messages are lost.

Returns
The state of the global connection state on success, SOL_NETCTL_STATE_UNKNOWN on failure
Examples:
/src/samples/network/netctl.c.

Referenced by manager_cb().

int sol_netctl_register_agent ( const struct sol_netctl_agent agent,
const void *  data 
)

register a agent for network connection

A single agent is registered for an application that registering a new agent.

See Also
struct sol_netctl_agent
Parameters
agentthe agent Callback struct to be called when the related information is updated.
dataAdd a user data per callback.
Returns
0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by startup().

int sol_netctl_request_input ( struct sol_netctl_service service,
const struct sol_ptr_vector inputs 
)

request the login input to connection

Request the login input for network connection. When the login information is needed in the process of network connection, the funcation can be used to input the login information for network connection. The login input information is informed via the agent callback. The agent must be registered before using sol_netctl_request_input.

See Also
sol_netctl_register_agent
Parameters
serviceThe service struct which the network connection is desired.
inputsthe ptr vector of input types and inputs from the user.
Returns
0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by request_input().

int sol_netctl_request_retry ( struct sol_netctl_service service,
bool  retry 
)

request retry the connection or not when error type is reported

Request retry the network connection or not when error type is reported. When the network connection failure, the user can select retry the connection or not retry it. The function can be used to select it. If retry connection is selected, the failure network connection will be tried to connect. If not retry connection is selected, the failure network connection will not be tried to connect. The connection failure information is informed via the agent callback. The agent must be registered before using sol_netctl_request_retry.

See Also
sol_netctl_register_agent
Parameters
serviceThe service struct which the network connection is desired.
retryTrue is retry the failure selected network connection, false is not retry the failure selected network connection.
Returns
0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by report_error().

int sol_netctl_scan ( void  )

request scan the surrounding devices

Request scan for the surrounding devices. This must be inovked AFTER sol_netctl_add_service_monitor.

See Also
sol_netctl_add_service_monitor
Returns
0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by startup().

int sol_netctl_service_connect ( struct sol_netctl_service service)

Connect the service.

This function connects the service, after the service is to give by service monitor. Since the netctl function is asynchronous, the return is not connection error, but just some dispatching/immediate error. The actual state change will be notified via sol_netctl_add_service_monitor() callbacks. The service connect error info will be notified by error monitor. This callbacks of sol_netctl_add_service_monitor and sol_netctl_add_error_monitor must be added BEFORE the sol_netctl_service_connect() is called to ensure no messages are lost.

Parameters
serviceThe service struct which the connection is desired
Returns
0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by service_cb().

int sol_netctl_service_disconnect ( struct sol_netctl_service service)

Disconnect the service.

This function disconnects the service. Since the netctl function is asynchronous, the return is not disconnection error, but just some dispatching/immediate error. The actual state change will be notified via sol_netctl_add_service_monitor() callbacks.The service disconnect error info will be notified by error monitor. This callbacks of sol_netctl_add_service_monitor and sol_netctl_add_error_monitor must be added BEFORE the sol_netctl_service_disconnect() is called to ensure no messages are lost.

Parameters
serviceThe service struct which the disconnection is desired
Returns
0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by service_cb().

const struct sol_ptr_vector* sol_netctl_service_get_domains ( const struct sol_netctl_service service)

Gets the service domains.

This function gets the service domains for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the service domains is desired
Returns
The retrieved content on success, NULL on failure.
const char* sol_netctl_service_get_error ( const struct sol_netctl_service service)

Gets the service error.

This function gets the error for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the name is desired
Returns
The error during connection or disconnection, NULL if no error occur.
const struct sol_netctl_ethernet* sol_netctl_service_get_ethernet ( const struct sol_netctl_service service)

Gets the service ethernet.

This function gets the service ethernet for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the service ethernet is desired
Returns
sol_netctl_ethernet struct on success, NULL on failure.
const char* sol_netctl_service_get_name ( const struct sol_netctl_service service)

Gets the service name.

This function gets the name for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the name is desired
Returns
The name of the services on success, NULL on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by error_cb(), service_cb(), and sol_netctl_find_service_by_name().

const struct sol_ptr_vector* sol_netctl_service_get_nameservers ( const struct sol_netctl_service service)

Gets the service nameservers.

This function gets the service nameservers for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the service nameservers is desired
Returns
The retrieved content on success, NULL on failure.
int sol_netctl_service_get_network_address ( const struct sol_netctl_service service,
struct sol_network_link **  link 
)

Gets the service network address.

This function gets the network address for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the network address is desired
linkThe retrieved content
Returns
0 on success, -errno on failure.
const struct sol_netctl_provider* sol_netctl_service_get_provider ( const struct sol_netctl_service service)

Gets the service provider.

This function gets the service provider for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the service provider is desired
Returns
sol_netctl_provider struct on success, NULL on failure.
const struct sol_netctl_proxy* sol_netctl_service_get_proxy ( const struct sol_netctl_service service)

Gets the service proxy.

This function gets the service proxy for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the service proxy is desired
Returns
sol_netctl_proxy struct on success, NULL on failure.
const struct sol_ptr_vector* sol_netctl_service_get_security ( const struct sol_netctl_service service)

Gets the service security methods.

This function gets the list of security methods or key management settings. Possible values are "none", "wep", "psk", "ieee8021x" and "wps".

Parameters
serviceThe service struct which the security is desired
Returns
A list of security methods for the given service.
Note
This methods might be only present for WiFi services.
enum sol_netctl_service_state sol_netctl_service_get_state ( const struct sol_netctl_service service)

Gets the service state.

This function gets the state for the netctl service, after the service is to give by service monitor.

Note
SOL_NETCTL_SERVICE_STATE_REMOVE is used to show the service has been removed. When it is notified, the service has been removed in the system.
Parameters
serviceThe service struct which the state is desired
Returns
The state of the services on success, SOL_NETCTL_SERVICE_STATE_UNKNOWN on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by service_cb().

int32_t sol_netctl_service_get_strength ( const struct sol_netctl_service service)

Gets the service strength.

This function gets the service strength for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the service strength is desired
Returns
The strength of the services on success, 0 on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by service_cb().

const struct sol_ptr_vector* sol_netctl_service_get_timeservers ( const struct sol_netctl_service service)

Gets the service timeservers.

This function gets the service timeservers for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the service timeservers is desired
Returns
The retrieved content on success, NULL on failure.
const char* sol_netctl_service_get_type ( const struct sol_netctl_service service)

Gets the service type.

This function gets the type for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the type is desired
Returns
The type of the services on success, NULL on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by service_cb().

bool sol_netctl_service_is_autoconnect ( const struct sol_netctl_service service)

Checks whether the service is autoconnect or not.

This function checks if the service is autoconnect or not for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the service autoconnect is desired
Returns
true if the service is autoconnect, otherwise false.
bool sol_netctl_service_is_favorite ( const struct sol_netctl_service service)

Checks whether the service is favorite or not.

This function checks if the service is favorite or not for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the service favorite is desired
Returns
true if the service is favorite, otherwise false.
bool sol_netctl_service_is_immutable ( const struct sol_netctl_service service)

Checks whether the service is immutable or not.

This function checks if the service is immutable or not for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the service immutable is desired
Returns
true if the service is immutable, otherwise false.
bool sol_netctl_service_is_roaming ( const struct sol_netctl_service service)

Checks whether the service is roaming or not.

This function checks if the service is autoconnect or not for the netctl service, after the service is to give by service monitor.

Parameters
serviceThe service struct which the service roaming is desired
Returns
true if the service is roaming, otherwise false.
enum sol_netctl_service_state sol_netctl_service_state_from_str ( const char *  state)

Converts a string service state to sol_netctl_service_state.

This function converts a string service state to enumeration sol_netctl_service_state.

See Also
sol_netctl_service_state_from_str().
Parameters
stateValid values are "unknown", "idle", "association", "configuration", "ready", "online", "disconnect", "failure", "remove".
Returns
enumeration sol_netctl_service_state.
const char* sol_netctl_service_state_to_str ( enum sol_netctl_service_state  state)

Converts sol_netctl_service_state to a string name.

This function converts sol_netctl_service_state enumeration to a string service state.

See Also
sol_netctl_service_state_to_str().
Parameters
statesol_netctl_service_state.
Returns
String representation of the sol_netctl_service_state..
int sol_netctl_set_radios_offline ( bool  enabled)

Sets the global connection state to offline.

This function sets the global connection state to offline, enter offline Mode too.

Parameters
enabledThe value is set for offline on/off
Returns
0 on success, -errno on failure.
int sol_netctl_unregister_agent ( void  )

unregister a agent for network connection

See Also
sol_netctl_register_agent
Returns
0 on success, -errno on failure.
Examples:
/src/samples/network/netctl.c.

Referenced by shutdown().