@@ -19,7 +19,8 @@ std::unique_ptr<HackRf> HackRf::open(uint32_t index) {
1919 std::cout << " Is open?" << std::endl;
2020
2121 if (rv < 0 ) {
22- std::cerr << " Unable to open Hackrf device: " << hackrf_error_name ((enum hackrf_error) rv) << std::endl;
22+ std::cerr << " Unable to open Hackrf device: "
23+ << hackrf_error_name ((enum hackrf_error)rv) << std::endl;
2324 exit (1 );
2425 }
2526
@@ -55,9 +56,7 @@ void HackRf::setSampleRate(uint32_t rate) {
5556 sampleRate_ = rate;
5657}
5758
58- uint32_t HackRf::getSampleRate () const {
59- return sampleRate_;
60- }
59+ uint32_t HackRf::getSampleRate () const { return sampleRate_; }
6160
6261void HackRf::setIfGain (int gain) {
6362 ASSERT (dev_ != nullptr );
@@ -80,8 +79,6 @@ void HackRf::setBbGain(int gain) {
8079 ASSERT (rv_amp >= 0 );
8180}
8281
83-
84-
8582void HackRf::setBiasTee (bool on) {
8683 ASSERT (dev_ != nullptr );
8784 auto rv = hackrf_set_antenna_enable (dev_, on ? 1 : 0 );
@@ -98,9 +95,9 @@ void HackRf::start(const std::shared_ptr<Queue<Samples> >& queue) {
9895 ASSERT (dev_ != nullptr );
9996 queue_ = queue;
10097 thread_ = std::thread ([&] {
101- auto rv = hackrf_start_rx (dev_, &hackrf_callback, this );
102- ASSERT (rv == 0 );
103- });
98+ auto rv = hackrf_start_rx (dev_, &hackrf_callback, this );
99+ ASSERT (rv == 0 );
100+ });
104101#ifdef __APPLE__
105102 pthread_setname_np (" hackrf" );
106103#else
@@ -123,10 +120,11 @@ void HackRf::stop() {
123120 queue_.reset ();
124121}
125122
126- void HackRf::process (size_t nsamples, unsigned char * buf, std::complex <float >* fo) {
123+ void HackRf::process (size_t nsamples, unsigned char * buf,
124+ std::complex <float >* fo) {
127125 for (uint32_t i = 0 ; i < nsamples; i++) {
128- fo[i].real ((static_cast <int8_t >(buf[i* 2 + 0 ]) / 128 .0f ));
129- fo[i].imag ((static_cast <int8_t >(buf[i* 2 + 1 ]) / 128 .0f ));
126+ fo[i].real ((static_cast <int8_t >(buf[i * 2 + 0 ]) / 128 .0f ));
127+ fo[i].imag ((static_cast <int8_t >(buf[i * 2 + 1 ]) / 128 .0f ));
130128 }
131129}
132130
0 commit comments