1 #ifndef INCLUDED_LIBCYBERRADIO_NDR651_PACKETIZER_H 2 #define INCLUDED_LIBCYBERRADIO_NDR651_PACKETIZER_H 4 #define DAC_RATE 102400000 6 #include <sys/socket.h> 7 #include <netinet/in.h> 8 #include <linux/if_ether.h> 9 #include <netinet/ip.h> 10 #include <netinet/udp.h> 11 #include <arpa/inet.h> 12 #include <linux/filter.h> 13 #include "LibCyberRadio/NDR651/TransmitSocket.h" 14 #include <netpacket/packet.h> 15 #include <net/ethernet.h> 17 #include <sys/types.h> 18 #include <sys/ioctl.h> 22 #include <sys/types.h> 26 #include "LibCyberRadio/Common/Debuggable.h" 27 #include "LibCyberRadio/NDR651/PacketTypes.h" 34 class Packetizer :
public Debuggable
38 std::string txInterfaceName;
39 unsigned short txUdpPort;
40 unsigned int samplesPerFrame;
41 unsigned long long sampleRate;
43 struct iovec txVec[3];
44 uint32_t fracTimestampIncrement;
47 void setVitaHeader(
unsigned short streamId);
48 void incrementVitaHeader();
49 void initBroadcastTxSocket(
const std::string &txInterfaceName,
unsigned short port);
50 unsigned long long calculateSampleRate(
unsigned int ducRateIndex);
54 Packetizer(
const std::string &txInterfaceName,
unsigned short port,
unsigned int ducRateIndex,
bool debug =
false);
59 void sendFrame(
short * samples);
60 void setSamplesPerFrame(
unsigned int samplesPerFrame);
Defines functionality for LibCyberRadio applications.