From b9047de035ab79b54fe21a9cada8d0e001c008a7 Mon Sep 17 00:00:00 2001 From: Alexey P Date: Sun, 18 Dec 2016 09:37:08 +0300 Subject: [PATCH] split livolo packet to addr and cmd --- librf/RFProtocolLivolo.cpp | 9 ++++++++- librf/RFProtocolLivolo.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/librf/RFProtocolLivolo.cpp b/librf/RFProtocolLivolo.cpp index 4812743..70b5297 100644 --- a/librf/RFProtocolLivolo.cpp +++ b/librf/RFProtocolLivolo.cpp @@ -67,4 +67,11 @@ string CRFProtocolLivolo::DecodePacket(const string&packet) } return bits; -} \ No newline at end of file +} + +string CRFProtocolLivolo::DecodeData(const string& bits) +{ + int addr = bits2long(bits, 0, 16); + int cmd = bits2long(bits, 16, 7); + +} diff --git a/librf/RFProtocolLivolo.h b/librf/RFProtocolLivolo.h index bf98b7b..de833ab 100644 --- a/librf/RFProtocolLivolo.h +++ b/librf/RFProtocolLivolo.h @@ -9,6 +9,7 @@ class RFLIB_API CRFProtocolLivolo : virtual string getName() { return "Livolo"; }; virtual string DecodePacket(const string&); + virtual string DecodeData(const string&); // Преобразование бит в данные };