From 9c1c9cf850b636100c04eaec932cd297dc83c9bd Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 20 Jul 2017 23:42:29 +0200 Subject: [PATCH] HackRF: added configure frquency delta common message --- devices/hackrf/CMakeLists.txt | 2 ++ devices/hackrf/devicehackrfshared.cpp | 21 ++++++++++++ devices/hackrf/devicehackrfshared.h | 47 +++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 devices/hackrf/devicehackrfshared.cpp create mode 100644 devices/hackrf/devicehackrfshared.h diff --git a/devices/hackrf/CMakeLists.txt b/devices/hackrf/CMakeLists.txt index 76b2b6faf..bef8053ef 100644 --- a/devices/hackrf/CMakeLists.txt +++ b/devices/hackrf/CMakeLists.txt @@ -3,12 +3,14 @@ project(hackrfdevice) set(hackrfdevice_SOURCES devicehackrf.cpp devicehackrfvalues.cpp + devicehackrfshared.cpp ) set(hackrfdevice_HEADERS devicehackrf.h devicehackrfparam.h devicehackrfvalues.h + devicehackrfshared.h ) if (BUILD_DEBIAN) diff --git a/devices/hackrf/devicehackrfshared.cpp b/devices/hackrf/devicehackrfshared.cpp new file mode 100644 index 000000000..aa7092369 --- /dev/null +++ b/devices/hackrf/devicehackrfshared.cpp @@ -0,0 +1,21 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2017 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include "devicehackrfshared.h" + +MESSAGE_CLASS_DEFINITION(DeviceHackRFShared::MsgConfigureFrequencyDelta, Message) + + diff --git a/devices/hackrf/devicehackrfshared.h b/devices/hackrf/devicehackrfshared.h new file mode 100644 index 000000000..c1b3d32d2 --- /dev/null +++ b/devices/hackrf/devicehackrfshared.h @@ -0,0 +1,47 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2017 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef DEVICES_HACKRF_DEVICEHACKRFSHARED_H_ +#define DEVICES_HACKRF_DEVICEHACKRFSHARED_H_ + +#include "util/message.h" + +class DeviceHackRFShared +{ + class MsgConfigureFrequencyDelta : public Message + { + MESSAGE_CLASS_DECLARATION + + public: + int getFrequencyDelta() const { return m_frequencyDelta; } + + static MsgConfigureFrequencyDelta *create(int frequencyDelta) + { + return new MsgConfigureFrequencyDelta(frequencyDelta); + } + + private: + int m_frequencyDelta; + + MsgConfigureFrequencyDelta(int frequencyDelta) : + Message(), + m_frequencyDelta(frequencyDelta) + { } + }; +}; + + +#endif /* DEVICES_HACKRF_DEVICEHACKRFSHARED_H_ */