From 36b3e7f310c624b7b4e31829090dd02131c528d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C5=ABnas=20Ma=C5=BEeikis?= Date: Tue, 21 May 2019 19:16:22 +0300 Subject: Protocol: implementation of device-side protocol. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parts of protocol specific for device are implementepd to reflect the fact that the device is a client. This effectively means that device gets a single connection only and severe memory restrictions about which the daemon might get informed about in the future. Signed-off-by: Ramūnas Mažeikis --- include/protocol.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/protocol.h') diff --git a/include/protocol.h b/include/protocol.h index 60d31ea..c5e657b 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -106,12 +106,12 @@ struct tlv { * Reads last packets received, parses and stores them to be later retreived * via get_tlv. * */ -void get_last_data(cd_t connection); +int get_last_data(cd_t connection); /** Returns tlv's parsed by get_last_data. Returned tlv is only valid until * next call to get_tlv. * */ -struct tlv * get_tlv(void); +struct tlv * get_tlv(cd_t cd); /** * Any modifications made to the pending outgoing packet are nullified. @@ -129,4 +129,6 @@ int push_data(cd_t connection, const char *data, enum tlv_type); * */ void flush_data(cd_t connection); +cd_t protocol_init(void); + #endif /* PROTOCOL_H_INCLUDED */ -- cgit v1.2.3