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

Stands in for Elodin: accepts one connection and keeps every byte written to it. More...

Collaboration diagram for FakeElodin:
[legend]

Public Member Functions

bool start ()
void stop ()
uint16_t port () const
std::vector< uint8_t > commanded (uint8_t hi, uint8_t lo)
 Every commanded state written to [hi, lo], in order: the actuator_state byte.

Private Attributes

int fd_ = -1
uint16_t port_ = 0
std::atomic< bool > run_ {true}
std::thread thread_
std::mutex m_
std::vector< uint8_t > bytes_

Detailed Description

Stands in for Elodin: accepts one connection and keeps every byte written to it.

Definition at line 44 of file test_ball_valve_commander.cpp.

Member Function Documentation

◆ commanded()

std::vector< uint8_t > FakeElodin::commanded ( uint8_t hi,
uint8_t lo )
inline

Every commanded state written to [hi, lo], in order: the actuator_state byte.

Definition at line 91 of file test_ball_valve_commander.cpp.

References bytes_, lk, and m_.

Referenced by main().

◆ port()

uint16_t FakeElodin::port ( ) const
inline

Definition at line 86 of file test_ball_valve_commander.cpp.

References port_.

Referenced by main().

◆ start()

bool FakeElodin::start ( )
inline

Definition at line 46 of file test_ball_valve_commander.cpp.

References bytes_, fd_, lk, m_, port_, read(), run_, and thread_.

Referenced by main().

◆ stop()

void FakeElodin::stop ( )
inline

Definition at line 80 of file test_ball_valve_commander.cpp.

References fd_, run_, and thread_.

Referenced by main().

Member Data Documentation

◆ bytes_

std::vector<uint8_t> FakeElodin::bytes_
private

Definition at line 112 of file test_ball_valve_commander.cpp.

Referenced by commanded(), and start().

◆ fd_

int FakeElodin::fd_ = -1
private

Definition at line 107 of file test_ball_valve_commander.cpp.

Referenced by start(), and stop().

◆ m_

std::mutex FakeElodin::m_
private

Definition at line 111 of file test_ball_valve_commander.cpp.

Referenced by commanded(), and start().

◆ port_

uint16_t FakeElodin::port_ = 0
private

Definition at line 108 of file test_ball_valve_commander.cpp.

Referenced by port(), and start().

◆ run_

std::atomic<bool> FakeElodin::run_ {true}
private

Definition at line 109 of file test_ball_valve_commander.cpp.

Referenced by start(), and stop().

◆ thread_

std::thread FakeElodin::thread_
private

Definition at line 110 of file test_ball_valve_commander.cpp.

Referenced by start(), and stop().


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