GNU Radio's LINRAD Package
send_raw24_impl.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2017 Daniel Estevez <daniel@destevez.net>
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef INCLUDED_LINRAD_SEND_RAW24_IMPL_H
22#define INCLUDED_LINRAD_SEND_RAW24_IMPL_H
23
24#include <linrad/send_raw24.h>
25
26
27#include <sys/types.h>
28#include <sys/socket.h>
29#include <netinet/in.h>
30
31#include "header.h"
32#define BYTES_PER_SAMPLE 3
33#define SAMPLES_PER_PACKET (NET_MULTICAST_PAYLOAD/(BYTES_PER_SAMPLE*2))
34
35namespace gr {
36 namespace linrad {
37
39 {
40 float d_passband_center;
41
42 private:
43 uint32_t d_bufsize;
44 uint32_t d_ptr;
45 uint16_t d_block_no;
46 int d_socket;
47 struct sockaddr_in d_sockaddr;
48
49
50 public:
51 send_raw24_impl(char *ip, int base_port, float passband_center, int bufsize);
53
54 // Where all the action really happens
55 int work(int noutput_items,
56 gr_vector_const_void_star &input_items,
57 gr_vector_void_star &output_items);
58
59 float frequency() const { return d_passband_center; }
60 void set_frequency(float f) { d_passband_center = f; }
61 };
62 } // namespace linrad
63} // namespace gr
64
65#endif /* INCLUDED_LINRAD_SEND_RAW24_IMPL_H */
66
Definition: send_raw24_impl.h:39
void set_frequency(float f)
Definition: send_raw24_impl.h:60
send_raw24_impl(char *ip, int base_port, float passband_center, int bufsize)
float frequency() const
Definition: send_raw24_impl.h:59
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
<+description of block+>
Definition: send_raw24.h:37
Definition: send_raw16.h:28