SlaveErrorRegistersDevice.cpp
Go to the documentation of this file.
2 
4 {
5  void
7  {
8  ARMARX_CHECK_EQUAL(data->slaveIndex, this->slaveIndex);
9 
10  auto update = [&](std::uint8_t* member, datatypes::RegisterEnum registertype)
11  {
12  if (data->registerData.count(registertype))
13  {
14  *member = std::get<datatypes::EtherCATDataType::UNSIGNED8>(
15  data->registerData.at(registertype));
16  }
17  };
18 
21  // update(&value.linkLostCounterPort2, datatypes::RegisterEnum::LOST_LINK_COUNTER_PORT_2);
22  // update(&value.linkLostCounterPort3, datatypes::RegisterEnum::LOST_LINK_COUNTER_PORT_3);
23 
26  // update(&value.frameErrorCounterPort2, datatypes::RegisterEnum::FRAME_ERROR_COUNTER_PORT_2);
27  // update(&value.frameErrorCounterPort3, datatypes::RegisterEnum::FRAME_ERROR_COUNTER_PORT_3);
28 
31  // update(&value.rxErrorCounterPort2, datatypes::RegisterEnum::PHYSICAL_ERROR_COUNTER_PORT_2);
32  // update(&value.rxErrorCounterPort3, datatypes::RegisterEnum::PHYSICAL_ERROR_COUNTER_PORT_3);
33 
38  // update(&value.forwardedRxErrorCounterPort2,
39  // datatypes::RegisterEnum::PREVIOUS_ERROR_COUNTER_PORT_2);
40  // update(&value.forwardedRxErrorCounterPort3,
41  // datatypes::RegisterEnum::PREVIOUS_ERROR_COUNTER_PORT_3);
42  }
43 } // namespace armarx::control::ethercat
armarx::control::ethercat::SlaveErrorRegistersSensorValue::frameErrorCounterPort1
std::uint8_t frameErrorCounterPort1
Definition: SlaveErrorRegistersDevice.h:22
armarx::control::ethercat::SlaveErrorRegistersSensorValue::linkLostCounterPort1
std::uint8_t linkLostCounterPort1
Definition: SlaveErrorRegistersDevice.h:17
armarx::control::ethercat::SlaveErrorRegistersDevice::value
SlaveErrorRegistersSensorValue value
Definition: SlaveErrorRegistersDevice.h:108
armarx::control::ethercat::SlaveErrorRegistersSensorValue::rxErrorCounterPort0
std::uint8_t rxErrorCounterPort0
Definition: SlaveErrorRegistersDevice.h:26
armarx::control::ethercat::datatypes::RegisterEnum
RegisterEnum
The RegisterEnum enum encodes the slave registers that every slave offers.
Definition: SlaveRegisters.h:37
armarx::control::ethercat::datatypes::RegisterEnum::PREVIOUS_ERROR_COUNTER_PORT_0
@ PREVIOUS_ERROR_COUNTER_PORT_0
armarx::control::ethercat::SlaveErrorRegistersSensorValue::frameErrorCounterPort0
std::uint8_t frameErrorCounterPort0
Definition: SlaveErrorRegistersDevice.h:21
armarx::control::ethercat::datatypes::RegisterEnum::FRAME_ERROR_COUNTER_PORT_1
@ FRAME_ERROR_COUNTER_PORT_1
armarx::control::ethercat::datatypes::RegisterEnum::LOST_LINK_COUNTER_PORT_1
@ LOST_LINK_COUNTER_PORT_1
armarx::control::ethercat::RegisterDataList
Brief description of struct RegisterDataList.
Definition: SlaveRegisters.h:316
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::control::ethercat::SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort0
std::uint8_t forwardedRxErrorCounterPort0
Definition: SlaveErrorRegistersDevice.h:31
armarx::control::ethercat
Definition: Bus.cpp:24
armarx::control::ethercat::SlaveErrorRegistersDevice::updateValues
void updateValues(const RegisterDataList *data)
Definition: SlaveErrorRegistersDevice.cpp:6
armarx::control::ethercat::datatypes::RegisterEnum::PREVIOUS_ERROR_COUNTER_PORT_1
@ PREVIOUS_ERROR_COUNTER_PORT_1
armarx::control::ethercat::SlaveErrorRegistersSensorValue::linkLostCounterPort0
DETAIL_SensorValueBase_DEFAULT_METHOD_IMPLEMENTATION std::uint8_t linkLostCounterPort0
Definition: SlaveErrorRegistersDevice.h:16
SlaveErrorRegistersDevice.h
armarx::armem::server::ltm::util::mongodb::detail::update
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition: mongodb.cpp:67
armarx::control::ethercat::datatypes::RegisterEnum::PHYSICAL_ERROR_COUNTER_PORT_0
@ PHYSICAL_ERROR_COUNTER_PORT_0
armarx::control::ethercat::datatypes::RegisterEnum::PHYSICAL_ERROR_COUNTER_PORT_1
@ PHYSICAL_ERROR_COUNTER_PORT_1
ARMARX_CHECK_EQUAL
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
Definition: ExpressionException.h:130
armarx::control::ethercat::SlaveErrorRegistersSensorValue::rxErrorCounterPort1
std::uint8_t rxErrorCounterPort1
Definition: SlaveErrorRegistersDevice.h:27
armarx::control::ethercat::datatypes::RegisterEnum::FRAME_ERROR_COUNTER_PORT_0
@ FRAME_ERROR_COUNTER_PORT_0
armarx::control::ethercat::SlaveErrorRegistersSensorValue::forwardedRxErrorCounterPort1
std::uint8_t forwardedRxErrorCounterPort1
Definition: SlaveErrorRegistersDevice.h:32
armarx::control::ethercat::datatypes::RegisterEnum::LOST_LINK_COUNTER_PORT_0
@ LOST_LINK_COUNTER_PORT_0