48 TimingController::do_configure(data);
53 configure_hardware_or_recover_state<TimingEndpointNotReady>(data,
"Timing endpoint",
m_endpoint_state);
55 TLOG() << get_name() <<
" conf done for endpoint, device: " << m_timing_device;
62 std::this_thread::sleep_for(std::chrono::microseconds(7000000));
76 hw_cmd.
device = m_timing_device;
84 construct_hw_cmd(
"endpoint_enable", data);
91 send_hw_cmd(std::move(hw_cmd));
92 ++(m_sent_hw_command_counters.at(2).atomic);
99 construct_hw_cmd(
"endpoint_disable", data);
100 send_hw_cmd(std::move(hw_cmd));
101 ++(m_sent_hw_command_counters.at(3).atomic);
108 construct_hw_cmd(
"endpoint_reset", data);
110 send_hw_cmd(std::move(hw_cmd));
111 ++(m_sent_hw_command_counters.at(4).atomic);
133 ++m_device_infos_received_count;
136 from_json(info, device_info);
141 bool ready = ept_info.ready;
143 TLOG_DEBUG(3) <<
"state: 0x" << std::hex <<
m_endpoint_state <<
", ready: " << ready << std::dec <<
", infos received: " << m_device_infos_received_count;
149 m_device_ready =
true;
150 TLOG_DEBUG(2) <<
"Timing endpoint became ready";
157 m_device_ready =
false;
158 TLOG_DEBUG(2) <<
"Timing endpoint no longer ready";
virtual void do_endpoint_disable(const nlohmann::json &data)
void do_configure(const nlohmann::json &data) override
timingcmd::TimingHwCmd construct_endpoint_hw_cmd(const std::string &cmd_id, uint endpoint_id)
void process_device_info(nlohmann::json info) override
void send_configure_hardware_commands(const nlohmann::json &data) override
TimingEndpointControllerBase(const std::string &name, uint number_hw_commands)
TimingEndpointControllerBase Constructor.
virtual void do_endpoint_reset(const nlohmann::json &data)
uint m_managed_endpoint_id
std::atomic< uint > m_endpoint_state
virtual void do_endpoint_enable(const nlohmann::json &data)
#define TLOG_DEBUG(lvl,...)
void from_json(const data_t &j, EndpointLocation &obj)
void to_json(data_t &j, const EndpointLocation &obj)
timingendpointinfo::TimingEndpointInfo endpoint_info
TimingHwCmdPayload payload