summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/syslog_relay.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/syslog_relay.c b/src/syslog_relay.c
index 2936700..b908153 100644
--- a/src/syslog_relay.c
+++ b/src/syslog_relay.c
@@ -232,6 +232,20 @@ void *syslog_relay_worker(void *arg)
232 return NULL; 232 return NULL;
233} 233}
234 234
235/**
236 * Starts capturing the syslog of the device using a callback.
237 *
238 * Use syslog_relay_stop_capture() to stop receiving the syslog.
239 *
240 * @param client The syslog_relay client to use
241 * @param callback Callback to receive each character from the syslog.
242 * @param user_data Custom pointer passed to the callback function.
243 *
244 * @return SYSLOG_RELAY_E_SUCCESS on success,
245 * SYSLOG_RELAY_E_INVALID_ARG when one or more parameters are
246 * invalid or SYSLOG_RELAY_E_UNKNOWN_ERROR when an unspecified
247 * error occurs or a syslog capture has already been started.
248 */
235syslog_relay_error_t syslog_relay_start_capture(syslog_relay_client_t client, syslog_relay_receive_cb_t callback, void* user_data) 249syslog_relay_error_t syslog_relay_start_capture(syslog_relay_client_t client, syslog_relay_receive_cb_t callback, void* user_data)
236{ 250{
237 if (!client || !callback) 251 if (!client || !callback)
@@ -259,6 +273,18 @@ syslog_relay_error_t syslog_relay_start_capture(syslog_relay_client_t client, sy
259 return res; 273 return res;
260} 274}
261 275
276/**
277 * Stops capturing the syslog of the device.
278 *
279 * Use syslog_relay_start_capture() to start receiving the syslog.
280 *
281 * @param client The syslog_relay client to use
282 *
283 * @return SYSLOG_RELAY_E_SUCCESS on success,
284 * SYSLOG_RELAY_E_INVALID_ARG when one or more parameters are
285 * invalid or SYSLOG_RELAY_E_UNKNOWN_ERROR when an unspecified
286 * error occurs or a syslog capture has already been started.
287 */
262syslog_relay_error_t syslog_relay_stop_capture(syslog_relay_client_t client) 288syslog_relay_error_t syslog_relay_stop_capture(syslog_relay_client_t client)
263{ 289{
264 if (client->worker) { 290 if (client->worker) {