16 #ifndef PSEN_SCAN_V2_STANDALONE_IO_STATE_CONVERSIONS_H 17 #define PSEN_SCAN_V2_STANDALONE_IO_STATE_CONVERSIONS_H 26 namespace data_conversion_layer
29 std::size_t byte_location,
30 std::size_t bit_location)
32 return {
static_cast<uint32_t
>(byte_location * 8 + bit_location),
34 pin_data.
input_state.at(byte_location).test(bit_location) };
38 std::size_t byte_location,
39 std::size_t bit_location)
41 return {
static_cast<uint32_t
>(byte_location * 8 + bit_location),
43 pin_data.
output_state.at(byte_location).test(bit_location) };
60 std::vector<PinState> pin_states;
63 for (std::size_t bit_n = 0; bit_n < 8; ++bit_n)
76 std::vector<PinState> pin_states;
79 for (std::size_t bit_n = 0; bit_n < 8; ++bit_n)
93 std::vector<PinState> pin_states;
94 for (std::size_t byte_n = 0; byte_n < new_state.
input_state.size(); ++byte_n)
96 for (std::size_t bit_n = 0; bit_n < 8; ++bit_n)
111 std::vector<PinState> pin_states;
112 for (std::size_t byte_n = 0; byte_n < new_state.
output_state.size(); ++byte_n)
114 for (std::size_t bit_n = 0; bit_n < 8; ++bit_n)
129 #endif // PSEN_SCAN_V2_STANDALONE_IO_STATE_CONVERSIONS_H static std::string getOutputName(std::size_t byte_location, std::size_t bit_location)
static OutputType getOutputType(std::size_t byte_location, std::size_t bit_location)
static std::string getInputName(std::size_t byte_location, std::size_t bit_location)
Represents a single I/O pin.
static std::vector< PinState > generateChangedOutputStates(const monitoring_frame::io::PinData &new_state, const monitoring_frame::io::PinData &old_state)
static std::vector< PinState > generateChangedInputStates(const monitoring_frame::io::PinData &new_state, const monitoring_frame::io::PinData &old_state)
static PinState generateInputPinState(const monitoring_frame::io::PinData &pin_data, std::size_t byte_location, std::size_t bit_location)
static constexpr uint32_t NUMBER_OF_OUTPUT_BYTES
Represents the IO PIN field of a monitoring frame.
static std::vector< PinState > generateOutputPinStates(const monitoring_frame::io::PinData &pin_data)
static constexpr uint32_t NUMBER_OF_INPUT_BYTES
static PinState generateOutputPinState(const monitoring_frame::io::PinData &pin_data, std::size_t byte_location, std::size_t bit_location)
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
static bool isUsedInputBit(std::size_t byte_n, std::size_t bit_n)
static LogicalInputType getInputType(std::size_t byte_location, std::size_t bit_location)
std::array< std::bitset< 8 >, NUMBER_OF_OUTPUT_BYTES > output_state
std::array< std::bitset< 8 >, NUMBER_OF_INPUT_BYTES > input_state
static bool isUsedOutputBit(std::size_t byte_n, std::size_t bit_n)
static std::vector< PinState > generateInputPinStates(const monitoring_frame::io::PinData &pin_data)