From 7b18a105db637d1ea625bd41f35e52df41165fa3 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 16 Feb 2016 15:55:06 +0100 Subject: Add readout and trigger API --- uca-net-client.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'uca-net-client.c') diff --git a/uca-net-client.c b/uca-net-client.c index c92eedd..471d039 100644 --- a/uca-net-client.c +++ b/uca-net-client.c @@ -134,22 +134,37 @@ uca_net_client_set_property (GSocketConnection *connection, const gchar *name, c return handle_default_reply (connection, UCA_NET_MESSAGE_SET_PROPERTY, error); } -void -uca_net_client_start_recording (GSocketConnection *connection, GError **error) +static void +default_handshake (GSocketConnection *connection, UcaNetMessageType type, GError **error) { - if (!send_default_message (connection, UCA_NET_MESSAGE_START_RECORDING, error)) + if (!send_default_message (connection, type, error)) return; - handle_default_reply (connection, UCA_NET_MESSAGE_START_RECORDING, error); + handle_default_reply (connection, type, error); +} + +void +uca_net_client_start_recording (GSocketConnection *connection, GError **error) +{ + default_handshake (connection, UCA_NET_MESSAGE_START_RECORDING, error); } void uca_net_client_stop_recording (GSocketConnection *connection, GError **error) { - if (!send_default_message (connection, UCA_NET_MESSAGE_STOP_RECORDING, error)) - return; + default_handshake (connection, UCA_NET_MESSAGE_STOP_RECORDING, error); +} - handle_default_reply (connection, UCA_NET_MESSAGE_STOP_RECORDING, error); +void +uca_net_client_start_readout (GSocketConnection *connection, GError **error) +{ + default_handshake (connection, UCA_NET_MESSAGE_START_READOUT, error); +} + +void +uca_net_client_stop_readout (GSocketConnection *connection, GError **error) +{ + default_handshake (connection, UCA_NET_MESSAGE_STOP_READOUT, error); } gboolean -- cgit v1.2.3