RegisterReadRequest.cpp
Go to the documentation of this file.
2
3#include <sstream>
4
6
9
11{
12
15 {
18 this->amountFramesToRead = static_cast<std::uint16_t>(frames->list.size());
19 }
20
22 std::uint16_t amountFramesToRead)
23 {
24 if (preallocatedFrames)
25 {
26 frames = preallocatedFrames;
27 if (amountFramesToRead > 0)
28 {
29 this->amountFramesToRead = amountFramesToRead;
30 }
31 else
32 {
33 this->amountFramesToRead = static_cast<std::uint16_t>(frames->list.size());
34 }
35 }
36 }
37
38 std::pair<EtherCATFrameList*, std::uint16_t>
40 {
41 if (frames)
42 {
43 return {frames, amountFramesToRead};
44 }
45 else
46 {
47 throw std::logic_error("RegisterReadRequest: No EtherCATFrameList available");
48 }
49 }
50
51 void
60} // namespace armarx::control::ethercat
std::pair< EtherCATFrameList *, std::uint16_t > getFrames()
std::vector< RegisterDataList > * requestedRegisters
static void updateRegisterDataFromEtherCATFrameList(const EtherCATFrameList *frameList, std::vector< RegisterDataList > *requestedRegisters)
static EtherCATFrameList * createEtherCATFrameListFromRegisterDataList(const std::vector< RegisterDataList > *requestedRegisters)
The EtherCATFrameList struct holds a list of EtherCAT frames that can be scheduled in round-robin-sty...