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
Structure containing all the operations exposed by the loop module.
- Examples:
- bluetooth_test/artik_bluetooth_test.c, bluetooth_test/artik_bluetooth_test_advertiser.c, bluetooth_test/artik_bluetooth_test_agent.c, bluetooth_test/artik_bluetooth_test_avrcp.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, bluetooth_test/artik_bluetooth_test_spp_client.c, cloud_test/artik_cloud_test.c, gpio_test/artik_gpio_test.c, http_test/artik_http_test.c, loop_test/artik_loop_test.c, lwm2m_test/artik_lwm2m_test_client.c, media_test/artik_media_test.c, mqtt_test/artik_mqtt_cloud_test.c, network_test/artik_dhcp_client_test.c, network_test/artik_dhcp_server_test.c, network_test/artik_network_test.c, serial_test/artik_serial_test.c, time_test/artik_time_test.c, websocket_test/artik_websocket_client_test.c, websocket_test/artik_websocket_cloud_test.c, websocket_test/artik_websocket_test.c, wifi_test/artik_wifi_ap_test.c, wifi_test/artik_wifi_test.c, zigbee_test/artik_zigbee_cli.c, zigbee_test/artik_zigbee_test.c, and zigbee_test/artik_zigbee_test_common.c.
Definition at line 88 of file artik_loop.h.
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] fd File descriptor to watch [in] func The callback function to register [in] user_data The user data to be passed to the callback function [out] watch_id ID 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_id ID of the callback returned after creation [in] func The callback function to register [in] user_data The 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_id ID returned by the function for later reference of the timer [in] msec Period in milliseconds [in] func The callback function to register [in] user_data The 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] signum Signal to watch (Only SIGHUP, SIGINT, SIGTERM are supported) [in] func The callback function to register [in] user_data The user data to be passed to the callback function [out] signal_id ID 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_id ID returned by the function for later reference of the timer [in] msec Timeout in milliseconds [in] func The callback function to register [in] user_data The 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_id ID 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_id ID 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_id ID of the timer to remove.
- Returns
- S_OK on success, error code otherwise
Definition at line 145 of file artik_loop.h.
| artik_error(* artik_loop_module::remove_signal_watch) (int signal_id) |
- Parameters
-
[in] signal_id ID of the watch to remove.
- 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, and bluetooth_test/artik_bluetooth_test_nap.c.
Definition at line 190 of file artik_loop.h.
| artik_error(* artik_loop_module::remove_timeout_callback) (int timeout_id) |
Remove only not already triggered timer.
- Parameters
-
[in] timeout_id ID 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:
- inc/base/artik_loop.h