Class UDPReceiveDB

Inheritance Relationships

Base Type

Class Documentation

class UDPReceiveDB : public ska::pst::recv::Receiver

Receives CBF/PSR packets with a standard UDP socket, writing the data and weights to ring buffers. Extending the ControlledReceiver, this class can be controlled via the LmcService.

Public Functions

UDPReceiveDB(std::shared_ptr<SocketReceive> sock, const std::string &host)

Construct a new UDPReceiveDB object using provided socket to receive data from the UDP endpoint at host.

Parameters
  • sockSocketReceive on which the data will be received

  • host – IPv4 address on the sock will used

UDPReceiveDB(std::shared_ptr<SocketReceive> sock, const std::string &host, int port)

Construct a new UDPReceiveDB object using provided socket to receive data from the UDP endpoint at host:port.

Parameters
  • sockSocketReceive on which the data will be received

  • host – IPv4 address on the sock will used

  • port – UDP port on which the sock will receive data

virtual ~UDPReceiveDB()

Destroy the UDPReceiveDB object. Unlocks and disconnects from the data and weights ring buffers.

void perform_configure_beam()

Configure the client with fixed parameters. Configures the client using the fixed configuration parameters that are common to all observations and available at launch. Configures the UDPFormat and UDPStats instances. Opens the UDP socket to receiveUDP packets.

Parameters

config – fixed configuration parameters

void perform_deconfigure_beam()

Release beam resources of the Receiver, which deallocates the receive socket and disconnects from the data and weights ring buffers.

void perform_configure_scan()

Processes the runtime configuration parameters in the header. Prepares the format with the runtime configuration parameters and opens the data blocks for writing.

void perform_deconfigure_scan()

Deconfigure the scan for the receiver, closing the transfer to the data and weights ring buffers, and reset the format, header and weights.

void perform_scan()

Scan callback that is called by ska::pst::common::ApplicationManager::main. Contains scanning instructions meant to be launched in a separate thread.

void perform_start_scan()

StartScan callback that is called by ska::pst::common::ApplicationManager::main. Contains the instructions required prior to transitioning the state from ScanConfigured to Scanning. Launches perform_scan on a separate thread.

void perform_terminate()

Terminate callback that is called by ka::pst::common::ApplicationManager::main. Contains the instructions required prior to transitioning the state from RuntimeError to Idle.

virtual uint64_t get_data_bufsz() override

Return the size of a data block element.

Returns

uint64_t size of data block buffer in bytes

Protected Attributes

std::unique_ptr<ska::pst::smrb::DataBlockWrite> db = {nullptr}

Output data block that will receive data samples from the UDP streams.

std::unique_ptr<ska::pst::smrb::DataBlockWrite> wb = {nullptr}

Output data block that will receive relative weights from the UDP streams.

std::shared_ptr<UDPFormat> format = {nullptr}

UDP format providing the mapping from UDP metadata to Ring Buffer byte offsets.

std::shared_ptr<SocketReceive> socket = {nullptr}

UDP Socket Receiver that that abstracts the receipt of UDP packets from the UDPFormat.