41 class ChangeStateRequest;
42 class ReadStatesRequest;
43 class SDOUpdateRequest;
44 class RegisterResetRequest;
45 class RegisterReadRequest;
48 struct EtherCATFrameList;
77 template <
typename T,
typename = std::enable_if_t<std::is_
integral_v<T>>>
81 std::uint8_t subIndex,
83 bool completeAccess =
false)
85 return generalSDOWrite(
108 std::uint8_t subIndex,
110 const unsigned char* buf,
111 bool completeAccess =
false)
113 return generalSDOWrite(slaveIndex,
index, subIndex, buflen, buf, completeAccess);
131 template <
typename T,
typename = std::enable_if_t<std::is_
integral_v<T>>>
135 std::uint8_t subIndex,
137 bool completeAccess =
false)
139 int buflen =
sizeof(result);
140 return generalSDORead(
141 slaveIndex,
index, subIndex, &buflen, &result, completeAccess);
163 std::uint8_t subIndex,
166 bool completeAccess =
false)
168 return generalSDORead(slaveIndex,
index, subIndex, buflen, buf, completeAccess);
179 bool readRegisters(std::vector<RegisterDataList>& registerData);
210 using IOMap = std::array<char, 4096>;
215 bool generalSDOWrite(std::uint16_t slaveIndex,
217 std::uint8_t subIndex,
218 std::uint16_t buflen,
220 bool completeAccess =
false);
222 bool generalSDORead(std::uint16_t slaveIndex,
224 std::uint8_t subIndex,
227 bool completeAccess =
false);
229 bool isSDOAccessAvailable()
const;
252 const std::vector<size_t>& slaveAddressOffsets);
256 std::thread requestHandlerThread;
257 std::atomic_bool requestHandlerThreadRunning{
true};
258 std::atomic_bool pdoUpdateRequested{
false};
260 void requestHandlerLoop();
262 bool handleNextRequest();
263 void handleSDOUpdateRequest(
const std::shared_ptr<SDOUpdateRequest>& request);
264 void handleChangeStateRequest(
const std::shared_ptr<ChangeStateRequest>& request);
265 void handleReadStatesRequest(
const std::shared_ptr<ReadStatesRequest>& request);
266 void handleRegisterResetRequest(
const std::shared_ptr<RegisterResetRequest>& request);
267 void handleRegisterReadRequest(
const std::shared_ptr<RegisterReadRequest>& request);