Filter results by

Older Versions

Older API versions are available as a download. To view, extract the file and open the index.html file in a web browser.

artik_loop_module Struct Reference

Loop module operations. More...

#include <base/artik_loop.h>

Data Fields

void(* run )(void)
 Runs a main loop until quit is called on the loop.
 
void(* quit )(void)
 Terminates the main loop.
 
artik_error(* add_timeout_callback )(int *timeout_id, unsigned int msec, timeout_callback func, void *user_data)
 Calls a function after a specified number of milliseconds. More...
 
artik_error(* remove_timeout_callback )(int timeout_id)
 Remove a registered timeout. More...
 
artik_error(* add_periodic_callback )(int *periodic_id, unsigned int msec, periodic_callback func, void *user_data)
 Calls a function after a specified number of milliseconds. More...
 
artik_error(* remove_periodic_callback )(int periodic_id)
 Remove a registered periodic. More...
 
artik_error(* add_fd_watch )(int fd, enum watch_io io, watch_callback func, void *user_data, int *watch_id)
 Add file-descriptor to use asynchronous. More...
 
artik_error(* remove_fd_watch )(int watch_id)
 Remove a registered fd watch. More...
 
artik_error(* add_signal_watch )(int signum, signal_callback func, void *user_data, int *signal_id)
 Add signal to watch. More...
 
artik_error(* remove_signal_watch )(int signal_id)
 Remove a registered signal watch. More...
 
artik_error(* add_idle_callback )(int *idle_id, idle_callback func, void *user_data)
 Calls a function after idle state in main loop. More...
 
artik_error(* remove_idle_callback )(int idle_id)
 Remove a registered idle. More...
 

Detailed Description

Field Documentation

artik_error(* artik_loop_module::add_fd_watch) (int fd, enum watch_io io, watch_callback func, void *user_data, int *watch_id)

Remove only not already triggered timer.

Parameters
[in]fdFile descriptor to watch
[in]funcThe callback function to register
[in]user_dataThe user data to be passed to the callback function
[out]watch_idID returned by the function for later reference of the timer.
Returns
S_OK on success, error code otherwise
Examples:
bluetooth_test/artik_bluetooth_test_ftp.c, bluetooth_test/artik_bluetooth_test_spp.c, bluetooth_test/artik_bluetooth_test_spp_client.c, lwm2m_test/artik_lwm2m_test_client.c, zigbee_test/artik_zigbee_cli.c, and zigbee_test/artik_zigbee_test.c.

Definition at line 160 of file artik_loop.h.

artik_error(* artik_loop_module::add_idle_callback) (int *idle_id, idle_callback func, void *user_data)
Parameters
[out]idle_idID of the callback returned after creation
[in]funcThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns
S_OK on success, error code otherwise

Definition at line 201 of file artik_loop.h.

artik_error(* artik_loop_module::add_periodic_callback) (int *periodic_id, unsigned int msec, periodic_callback func, void *user_data)
Parameters
[out]periodic_idID returned by the function for later reference of the timer
[in]msecPeriod in milliseconds
[in]funcThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns
S_OK on success, error code otherwise
Examples:
bluetooth_test/artik_bluetooth_test_gatt_server.c, loop_test/artik_loop_test.c, and websocket_test/artik_websocket_cloud_test.c.

Definition at line 134 of file artik_loop.h.

artik_error(* artik_loop_module::add_signal_watch) (int signum, signal_callback func, void *user_data, int *signal_id)
Parameters
[in]signumSignal to watch (Only SIGHUP, SIGINT, SIGTERM are supported)
[in]funcThe callback function to register
[in]user_dataThe user data to be passed to the callback function
[out]signal_idID returned by the function for later reference
Returns
S_OK on success, error code otherwise
Examples:
bluetooth_test/artik_bluetooth_test_advertiser.c, bluetooth_test/artik_bluetooth_test_ftp.c, bluetooth_test/artik_bluetooth_test_gatt_client.c, bluetooth_test/artik_bluetooth_test_gatt_server.c, bluetooth_test/artik_bluetooth_test_nap.c, bluetooth_test/artik_bluetooth_test_panu.c, bluetooth_test/artik_bluetooth_test_spp.c, and bluetooth_test/artik_bluetooth_test_spp_client.c.

Definition at line 181 of file artik_loop.h.

artik_error(* artik_loop_module::add_timeout_callback) (int *timeout_id, unsigned int msec, timeout_callback func, void *user_data)
Parameters
[out]timeout_idID returned by the function for later reference of the timer
[in]msecTimeout in milliseconds
[in]funcThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns
S_OK on success, error code otherwise
Examples:
bluetooth_test/artik_bluetooth_test.c, bluetooth_test/artik_bluetooth_test_avrcp.c, bluetooth_test/artik_bluetooth_test_ftp.c, bluetooth_test/artik_bluetooth_test_panu.c, bluetooth_test/artik_bluetooth_test_spp_client.c, loop_test/artik_loop_test.c, network_test/artik_network_test.c, websocket_test/artik_websocket_cloud_test.c, wifi_test/artik_wifi_test.c, and zigbee_test/artik_zigbee_test_common.c.

Definition at line 109 of file artik_loop.h.

artik_error(* artik_loop_module::remove_fd_watch) (int watch_id)
Parameters
[in]watch_idID of the watch to remove.
Returns
S_OK on success, error code otherwise
Examples:
bluetooth_test/artik_bluetooth_test_ftp.c, bluetooth_test/artik_bluetooth_test_spp.c, and bluetooth_test/artik_bluetooth_test_spp_client.c.

Definition at line 169 of file artik_loop.h.

artik_error(* artik_loop_module::remove_idle_callback) (int idle_id)
Parameters
[in]idle_idID of the idle to remove.
Returns
S_OK on success, error code otherwise

Definition at line 210 of file artik_loop.h.

artik_error(* artik_loop_module::remove_periodic_callback) (int periodic_id)

Remove only not already triggered periodic.

Parameters
[in]periodic_idID of the timer to remove.
Returns
S_OK on success, error code otherwise
Examples:
bluetooth_test/artik_bluetooth_test_gatt_server.c.

Definition at line 145 of file artik_loop.h.

artik_error(* artik_loop_module::remove_signal_watch) (int signal_id)
artik_error(* artik_loop_module::remove_timeout_callback) (int timeout_id)

Remove only not already triggered timer.

Parameters
[in]timeout_idID of the callback returned by add_timeout_callback
Returns
S_OK on success, error code otherwise
Examples:
bluetooth_test/artik_bluetooth_test_spp_client.c, and zigbee_test/artik_zigbee_test_common.c.

Definition at line 121 of file artik_loop.h.


The documentation for this struct was generated from the following file:
Last updated on: