STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
BoardListener Class Reference

Collects UDP actuator packets, folding the 3x retransmit of one batch into a single burst. More...

#include <BoardListener.hpp>

Collaboration diagram for BoardListener:
[legend]

Public Member Functions

 BoardListener (uint16_t port)
 ~BoardListener ()
bool start ()
void stop ()
std::vector< Burst > bursts () const

Private Member Functions

void run ()

Private Attributes

uint16_t port_
int sock_ = -1
std::atomic< bool > running_ {false}
std::thread thread_
std::mutex mutex_
std::vector< Burst > bursts_
Clock::time_point t0_

Detailed Description

Collects UDP actuator packets, folding the 3x retransmit of one batch into a single burst.

Actuator delay scheduling vs the 1 Hz republish.

The delicate part of per-actuator delays is not the timer, it is the interaction with ActuatorCommander's continuous loop, which re-sends every actuator's position once a second so a rebooted board recovers. Two ways that fights a delayed command, both of which this pins:

  1. The republish must NOT send the delayed actuator's settled position while its delay is pending — otherwise any delay longer than the republish period is unobservable, because the final value has already gone out. (Boards latch their last command, so the actuator is simply omitted and holds its pre-transition position.)
  2. The republish must NOT cancel the pending schedule. Cancellation is keyed to real state transitions only; an earlier version bumped the generation on every apply and the delayed stage never fired.

Drives the real ActuatorCommander over loopback UDP and asserts on what the "boards" receive.

Definition at line 43 of file BoardListener.hpp.

Constructor & Destructor Documentation

◆ BoardListener()

daqtest::BoardListener::BoardListener ( uint16_t port)
inlineexplicit

Definition at line 45 of file BoardListener.hpp.

◆ ~BoardListener()

Definition at line 47 of file BoardListener.hpp.

Member Function Documentation

◆ bursts()

std::vector< Burst > daqtest::BoardListener::bursts ( ) const
inline

Definition at line 87 of file BoardListener.hpp.

◆ run()

void daqtest::BoardListener::run ( )
inlineprivate

Definition at line 93 of file BoardListener.hpp.

◆ start()

Definition at line 51 of file BoardListener.hpp.

◆ stop()

Definition at line 76 of file BoardListener.hpp.

Member Data Documentation

◆ bursts_

std::vector<Burst> daqtest::BoardListener::bursts_
private

Definition at line 128 of file BoardListener.hpp.

◆ mutex_

std::mutex daqtest::BoardListener::mutex_
mutableprivate

Definition at line 127 of file BoardListener.hpp.

◆ port_

Definition at line 123 of file BoardListener.hpp.

◆ running_

std::atomic<bool> daqtest::BoardListener::running_ {false}
private

Definition at line 125 of file BoardListener.hpp.

◆ sock_

Definition at line 124 of file BoardListener.hpp.

◆ t0_

Clock::time_point daqtest::BoardListener::t0_
private

Definition at line 129 of file BoardListener.hpp.

◆ thread_

std::thread daqtest::BoardListener::thread_
private

Definition at line 126 of file BoardListener.hpp.


The documentation for this class was generated from the following file: