From 5ca7e24e58f6bd657787b9235247149ffff420ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C5=ABnas=20Ma=C5=BEeikis?= Date: Tue, 21 May 2019 19:28:23 +0300 Subject: Protocol: common no longer has device-specific implementations. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forgot to remove device-specific code from common protocol code. Signed-off-by: Ramūnas Mažeikis --- src/common/protocol.c | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'src/common/protocol.c') diff --git a/src/common/protocol.c b/src/common/protocol.c index 3d63771..dc0f532 100644 --- a/src/common/protocol.c +++ b/src/common/protocol.c @@ -33,47 +33,6 @@ #define READ_AS(from, type) (*(type*)(from)) -#define GET_MSG_CHAR(i) (msg_buf[(i) % MSG_BUF_SIZE]) -#define SET_MSG_CHAR(i, ch) msg_buf[(i) % MSG_BUF_SIZE] = (ch) - -/* Increment message cursor */ -#define IMC(x) ((msg_cursor + (x)) % MSG_BUF_SIZE) - -/* Begins at 2 because this way we'll have two null's at the beggining - * indicating that going back is not possible. - * */ -static int msg_cursor = 2; - -/** - * Message buffer. - * - * Two consecutive null's indicate that going back is not possible. - * */ -static char msg_buf[MSG_BUF_SIZE] = {0}; - -static int tlv_cursor = 0; -static struct tlv tlv_buf[TLV_BUF_SIZE] = {0}; - -static size_t packet_cursor = 0; -/* Outgoing packet. - * */ -static char packet_buf[PACKET_MAX_SIZE] = {0}; - -static int push_bytes(cd_t connection, const void * const data, const size_t size) -{ - if (packet_cursor + size >= PACKET_MAX_SIZE) { - return E_PACKET_OVERFLOW; - } - memcpy(packet_buf + packet_cursor, data, size); - packet_cursor += size; - return 0; -} - -void clear_data(cd_t connection) -{ - packet_cursor = 0; -} - int push_data(cd_t connection, const char *data, enum tlv_type type) { int ret = E_UNKNOWN_TYPE; -- cgit v1.2.3