1
0
mirror of https://github.com/JvanKatwijk/dab-cmdline synced 2025-10-05 23:52:50 +02:00
Files
SDR-DAB_dab-cmdline/devices/lime-handler/lime-handler.h
2025-06-22 19:12:39 +02:00

61 lines
1.9 KiB
C++

#
/*
* Copyright (C) 2014 .. 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the Dab library
*
* dab library 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; either version 2 of the License, or
* (at your option) any later version.
*
* dab library 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 for more details.
*
* You should have received a copy of the GNU General Public License
* along with dab library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#pragma once
#include <atomic>
#include <vector>
#include <thread>
#include "ringbuffer.h"
#include <LimeSuite.h>
#include "device-handler.h"
class limeHandler: public deviceHandler {
public:
limeHandler (int32_t frequency,
int16_t gain,
std::string antenna);
~limeHandler ();
bool restartReader (int32_t);
void stopReader ();
int32_t getSamples (std::complex<float> *,
int32_t);
int32_t Samples ();
void resetBuffer ();
int16_t bitDepth ();
private:
std::atomic<bool> running;
std::thread threadHandle;
int32_t frequency;
int16_t gain;
lms_device_t *theDevice;
lms_name_t antennas [10];
RingBuffer<std::complex<float>> *theBuffer;
lms_stream_meta_t meta;
lms_stream_t stream;
void run ();
};