Lely core libraries  2.3.4
lss_master.hpp
Go to the documentation of this file.
1 
24 #ifndef LELY_COAPP_LSS_MASTER_HPP_
25 #define LELY_COAPP_LSS_MASTER_HPP_
26 
27 #include <lely/coapp/node.hpp>
28 #include <lely/libc/functional.hpp>
30 
31 #include <chrono>
32 #include <memory>
33 #include <utility>
34 
35 namespace lely {
36 
37 namespace canopen {
38 
45 template <class T>
47 
54 template <class T>
56 
61 struct LssAddress {
62  LssAddress(uint32_t vendor_id_ = 0, uint32_t product_code_ = 0,
63  uint32_t revision_ = 0, uint32_t serial_nr_ = 0)
64  : vendor_id(vendor_id_),
65  product_code(product_code_),
66  revision(revision_),
67  serial_nr(serial_nr_) {}
68 
70  uint32_t vendor_id;
72  uint32_t product_code;
74  uint32_t revision;
76  uint32_t serial_nr;
77 };
78 
80 enum class LssState {
82  WAITING = 0,
87  CONFIG = 1
88 };
89 
90 class LssMaster;
91 
92 namespace detail {
93 
94 class LssRequestBase : public ev_task {
95  friend class canopen::LssMaster;
96 
97  public:
98  explicit LssRequestBase(ev_exec_t* exec)
99  : ev_task EV_TASK_INIT(exec, [](ev_task* task) noexcept {
100  (*static_cast<LssRequestBase*>(task))();
101  }) {}
102 
103  LssRequestBase(const LssRequestBase&) = delete;
104  LssRequestBase& operator=(const LssRequestBase&) = delete;
105 
106  virtual ~LssRequestBase() = default;
107 
110  GetExecutor() const noexcept {
111  return ev::Executor(ev_task::exec);
112  }
113 
115  ::std::error_code ec{};
116 
117  private:
118  virtual void operator()() noexcept = 0;
119 
120  virtual void OnRequest(void* data) noexcept = 0;
121 };
122 
124  public:
125  using LssRequestBase::LssRequestBase;
126 
129 
130  private:
131  void OnRequest(void* data) noexcept final;
132 };
133 
135  public:
136  using LssRequestBase::LssRequestBase;
137 
142  LssAddress address{0, 0, 0, 0};
143 
144  private:
145  void OnRequest(void* data) noexcept final;
146 };
147 
149  public:
150  using LssRequestBase::LssRequestBase;
151 
153  uint8_t id{0};
154 
155  private:
156  void OnRequest(void* data) noexcept final;
157 };
158 
160  public:
161  using LssRequestBase::LssRequestBase;
162 
164  int bitrate{0};
165 
166  private:
167  void OnRequest(void* data) noexcept final;
168 };
169 
171  public:
172  using LssRequestBase::LssRequestBase;
173 
178  int delay{0};
179 
180  private:
181  void OnRequest(void* data) noexcept final;
182 };
183 
185  public:
186  using LssRequestBase::LssRequestBase;
187 
188  private:
189  void OnRequest(void* data) noexcept final;
190 };
191 
193  public:
194  using LssRequestBase::LssRequestBase;
195 
197  uint32_t number{0};
198 };
199 
201  public:
202  using LssGetNumberRequestBase::LssGetNumberRequestBase;
203 
204  private:
205  void OnRequest(void* data) noexcept final;
206 };
207 
209  public:
210  using LssGetNumberRequestBase::LssGetNumberRequestBase;
211 
212  private:
213  void OnRequest(void* data) noexcept final;
214 };
215 
217  public:
218  using LssGetNumberRequestBase::LssGetNumberRequestBase;
219 
220  private:
221  void OnRequest(void* data) noexcept final;
222 };
223 
225  public:
226  using LssGetNumberRequestBase::LssGetNumberRequestBase;
227 
228  private:
229  void OnRequest(void* data) noexcept final;
230 };
231 
233  public:
234  using LssRequestBase::LssRequestBase;
235 
237  uint8_t id{0};
238 
239  private:
240  void OnRequest(void* data) noexcept final;
241 };
242 
244  public:
245  using LssRequestBase::LssRequestBase;
246 
247  private:
248  void OnRequest(void* data) noexcept final;
249 };
250 
252  public:
253  using LssRequestBase::LssRequestBase;
254 
259  LssAddress address{0, 0, 0, 0};
260 };
261 
263  public:
264  using LssScanRequestBase::LssScanRequestBase;
265 
267  LssAddress lo{0, 0, 0, 0};
272  LssAddress hi{0, 0, 0, 0};
273 
274  private:
275  void OnRequest(void* data) noexcept final;
276 };
277 
279  public:
280  using LssScanRequestBase::LssScanRequestBase;
281 
287  LssAddress mask{0, 0, 0, 0};
288 
289  private:
290  void OnRequest(void* data) noexcept final;
291 };
292 
293 } // namespace detail
294 
297  public:
306  using Signature = void(::std::error_code ec);
307 
313  template <class F>
314  explicit LssSwitchRequest(ev_exec_t* exec, F&& con)
315  : detail::LssSwitchRequestBase(exec), con_(::std::forward<F>(con)) {}
316 
318  template <class F>
319  explicit LssSwitchRequest(F&& con)
320  : LssSwitchRequest(nullptr, ::std::forward<F>(con)) {}
321 
322  private:
323  void
324  operator()() noexcept final {
325  if (con_) con_(ec);
326  }
327 
328  ::std::function<Signature> con_;
329 };
330 
333  public:
342  using Signature = void(::std::error_code ec);
343 
349  template <class F>
350  explicit LssSwitchSelectiveRequest(ev_exec_t* exec, F&& con)
351  : detail::LssSwitchSelectiveRequestBase(exec),
352  con_(::std::forward<F>(con)) {}
353 
355  template <class F>
356  explicit LssSwitchSelectiveRequest(F&& con)
357  : LssSwitchSelectiveRequest(nullptr, ::std::forward<F>(con)) {}
358 
359  private:
360  void
361  operator()() noexcept final {
362  if (con_) con_(ec);
363  }
364 
365  ::std::function<Signature> con_;
366 };
367 
370  public:
379  using Signature = void(::std::error_code ec);
380 
386  template <class F>
387  explicit LssSetIdRequest(ev_exec_t* exec, F&& con)
388  : detail::LssSetIdRequestBase(exec), con_(::std::forward<F>(con)) {}
389 
391  template <class F>
392  explicit LssSetIdRequest(F&& con)
393  : LssSetIdRequest(nullptr, ::std::forward<F>(con)) {}
394 
395  private:
396  void
397  operator()() noexcept final {
398  if (con_) con_(ec);
399  }
400 
401  ::std::function<Signature> con_;
402 };
403 
406  public:
415  using Signature = void(::std::error_code ec);
416 
422  template <class F>
423  explicit LssSetBitrateRequest(ev_exec_t* exec, F&& con)
424  : detail::LssSetBitrateRequestBase(exec), con_(::std::forward<F>(con)) {}
425 
427  template <class F>
428  explicit LssSetBitrateRequest(F&& con)
429  : LssSetBitrateRequest(nullptr, ::std::forward<F>(con)) {}
430 
431  private:
432  void
433  operator()() noexcept final {
434  if (con_) con_(ec);
435  }
436 
437  ::std::function<Signature> con_;
438 };
439 
442  public:
451  using Signature = void(::std::error_code ec);
452 
458  template <class F>
459  explicit LssSwitchBitrateRequest(ev_exec_t* exec, F&& con)
460  : detail::LssSwitchBitrateRequestBase(exec),
461  con_(::std::forward<F>(con)) {}
462 
464  template <class F>
465  explicit LssSwitchBitrateRequest(F&& con)
466  : LssSwitchBitrateRequest(nullptr, ::std::forward<F>(con)) {}
467 
468  private:
469  void
470  operator()() noexcept final {
471  if (con_) con_(ec);
472  }
473 
474  ::std::function<Signature> con_;
475 };
476 
479  public:
488  using Signature = void(::std::error_code ec);
489 
494  template <class F>
495  explicit LssStoreRequest(ev_exec_t* exec, F&& con)
496  : detail::LssStoreRequestBase(exec), con_(::std::forward<F>(con)) {}
497 
499  template <class F>
500  explicit LssStoreRequest(F&& con)
501  : LssStoreRequest(nullptr, ::std::forward<F>(con)) {}
502 
503  private:
504  void
505  operator()() noexcept final {
506  if (con_) con_(ec);
507  }
508 
509  ::std::function<Signature> con_;
510 };
511 
514  public:
525  using Signature = void(::std::error_code ec, uint32_t number);
526 
531  template <class F>
532  explicit LssGetVendorIdRequest(ev_exec_t* exec, F&& con)
533  : detail::LssGetVendorIdRequestBase(exec), con_(::std::forward<F>(con)) {}
534 
536  template <class F>
537  explicit LssGetVendorIdRequest(F&& con)
538  : LssGetVendorIdRequest(nullptr, ::std::forward<F>(con)) {}
539 
540  private:
541  void
542  operator()() noexcept final {
543  if (con_) con_(ec, number);
544  }
545 
546  ::std::function<Signature> con_;
547 };
548 
551  public:
562  using Signature = void(::std::error_code ec, uint32_t number);
563 
568  template <class F>
569  explicit LssGetProductCodeRequest(ev_exec_t* exec, F&& con)
570  : detail::LssGetProductCodeRequestBase(exec),
571  con_(::std::forward<F>(con)) {}
572 
574  template <class F>
575  explicit LssGetProductCodeRequest(F&& con)
576  : LssGetProductCodeRequest(nullptr, ::std::forward<F>(con)) {}
577 
578  private:
579  void
580  operator()() noexcept final {
581  if (con_) con_(ec, number);
582  }
583 
584  ::std::function<Signature> con_;
585 };
586 
589  public:
600  using Signature = void(::std::error_code ec, uint32_t number);
601 
606  template <class F>
607  explicit LssGetRevisionRequest(ev_exec_t* exec, F&& con)
608  : detail::LssGetRevisionRequestBase(exec), con_(::std::forward<F>(con)) {}
609 
611  template <class F>
612  explicit LssGetRevisionRequest(F&& con)
613  : LssGetRevisionRequest(nullptr, ::std::forward<F>(con)) {}
614 
615  private:
616  void
617  operator()() noexcept final {
618  if (con_) con_(ec, number);
619  }
620 
621  ::std::function<Signature> con_;
622 };
623 
626  public:
637  using Signature = void(::std::error_code ec, uint32_t number);
638 
643  template <class F>
644  explicit LssGetSerialNrRequest(ev_exec_t* exec, F&& con)
645  : detail::LssGetSerialNrRequestBase(exec), con_(::std::forward<F>(con)) {}
646 
648  template <class F>
649  explicit LssGetSerialNrRequest(F&& con)
650  : LssGetSerialNrRequest(nullptr, ::std::forward<F>(con)) {}
651 
652  private:
653  void
654  operator()() noexcept final {
655  if (con_) con_(ec, number);
656  }
657 
658  ::std::function<Signature> con_;
659 };
660 
663  public:
673  using Signature = void(::std::error_code ec, uint8_t id);
674 
679  template <class F>
680  explicit LssGetIdRequest(ev_exec_t* exec, F&& con)
681  : detail::LssGetIdRequestBase(exec), con_(::std::forward<F>(con)) {}
682 
684  template <class F>
685  explicit LssGetIdRequest(F&& con)
686  : LssGetIdRequest(nullptr, ::std::forward<F>(con)) {}
687 
688  private:
689  void
690  operator()() noexcept final {
691  if (con_) con_(ec, id);
692  }
693 
694  ::std::function<Signature> con_;
695 };
696 
699  public:
710  using Signature = void(::std::error_code ec, bool found);
711 
716  template <class F>
717  explicit LssIdNonConfigRequest(ev_exec_t* exec, F&& con)
718  : detail::LssStoreRequestBase(exec), con_(::std::forward<F>(con)) {}
719 
721  template <class F>
722  explicit LssIdNonConfigRequest(F&& con)
723  : LssIdNonConfigRequest(nullptr, ::std::forward<F>(con)) {}
724 
725  private:
726  void
727  operator()() noexcept final {
728  bool found = !ec;
729  // A timeout means no slave was found, but is otherwise not an error.
730  if (ec == ::std::errc::timed_out) ec.clear();
731  if (con_) con_(ec, found);
732  }
733 
734  ::std::function<Signature> con_;
735 };
736 
739  public:
749  using Signature = void(::std::error_code ec, LssAddress address);
750 
756  template <class F>
757  explicit LssSlowscanRequest(ev_exec_t* exec, F&& con)
758  : detail::LssSlowscanRequestBase(exec), con_(::std::forward<F>(con)) {}
759 
761  template <class F>
762  explicit LssSlowscanRequest(F&& con)
763  : LssSlowscanRequest(nullptr, ::std::forward<F>(con)) {}
764 
765  private:
766  void
767  operator()() noexcept final {
768  if (con_) con_(ec, address);
769  }
770 
771  ::std::function<Signature> con_;
772 };
773 
776  public:
786  using Signature = void(::std::error_code ec, LssAddress address);
787 
794  template <class F>
795  explicit LssFastscanRequest(ev_exec_t* exec, F&& con)
796  : detail::LssFastscanRequestBase(exec), con_(::std::forward<F>(con)) {}
797 
799  template <class F>
800  explicit LssFastscanRequest(F&& con)
801  : LssFastscanRequest(nullptr, ::std::forward<F>(con)) {}
802 
803  private:
804  void
805  operator()() noexcept final {
806  if (con_) con_(ec, address);
807  }
808 
809  ::std::function<Signature> con_;
810 };
811 
812 namespace detail {
813 
814 template <class F>
816  public:
817  explicit LssSwitchRequestWrapper(ev_exec_t* exec, LssState state, F&& con)
818  : LssSwitchRequestBase(exec), con_(::std::forward<F>(con)) {
819  this->state = state;
820  }
821 
822  private:
823  void
824  operator()() noexcept final {
825  compat::invoke(::std::move(con_), ec);
826  delete this;
827  }
828 
829  typename ::std::decay<F>::type con_;
830 };
831 
832 template <class F>
834  public:
836  const LssAddress& address, F&& con)
837  : LssSwitchSelectiveRequestBase(exec), con_(::std::forward<F>(con)) {
838  this->address = address;
839  }
840 
841  private:
842  void
843  operator()() noexcept final {
844  compat::invoke(::std::move(con_), ec);
845  delete this;
846  }
847 
848  typename ::std::decay<F>::type con_;
849 };
850 
851 template <class F>
853  public:
854  explicit LssSetIdRequestWrapper(ev_exec_t* exec, uint8_t id, F&& con)
855  : LssSetIdRequestBase(exec), con_(::std::forward<F>(con)) {
856  this->id = id;
857  }
858 
859  private:
860  void
861  operator()() noexcept final {
862  compat::invoke(::std::move(con_), ec);
863  delete this;
864  }
865 
866  typename ::std::decay<F>::type con_;
867 };
868 
869 template <class F>
871  public:
872  explicit LssSetBitrateRequestWrapper(ev_exec_t* exec, int bitrate, F&& con)
873  : LssSetBitrateRequestBase(exec), con_(::std::forward<F>(con)) {
874  this->bitrate = bitrate;
875  }
876 
877  private:
878  void
879  operator()() noexcept final {
880  compat::invoke(::std::move(con_), ec);
881  delete this;
882  }
883 
884  typename ::std::decay<F>::type con_;
885 };
886 
887 template <class F>
889  public:
890  explicit LssSwitchBitrateRequestWrapper(ev_exec_t* exec, int delay, F&& con)
891  : LssSwitchBitrateRequestBase(exec), con_(::std::forward<F>(con)) {
892  this->delay = delay;
893  }
894 
895  private:
896  void
897  operator()() noexcept final {
898  compat::invoke(::std::move(con_), ec);
899  delete this;
900  }
901 
902  typename ::std::decay<F>::type con_;
903 };
904 
905 template <class F>
907  public:
908  explicit LssStoreRequestWrapper(ev_exec_t* exec, F&& con)
909  : LssStoreRequestBase(exec), con_(::std::forward<F>(con)) {}
910 
911  private:
912  void
913  operator()() noexcept final {
914  compat::invoke(::std::move(con_), ec);
915  delete this;
916  }
917 
918  typename ::std::decay<F>::type con_;
919 };
920 
921 template <class F>
923  public:
924  explicit LssGetVendorIdRequestWrapper(ev_exec_t* exec, F&& con)
925  : LssGetVendorIdRequestBase(exec), con_(::std::forward<F>(con)) {}
926 
927  private:
928  void
929  operator()() noexcept final {
930  compat::invoke(::std::move(con_), ec, number);
931  delete this;
932  }
933 
934  typename ::std::decay<F>::type con_;
935 };
936 
937 template <class F>
939  public:
940  explicit LssGetProductCodeRequestWrapper(ev_exec_t* exec, F&& con)
941  : LssGetProductCodeRequestBase(exec), con_(::std::forward<F>(con)) {}
942 
943  private:
944  void
945  operator()() noexcept final {
946  compat::invoke(::std::move(con_), ec, number);
947  delete this;
948  }
949 
950  typename ::std::decay<F>::type con_;
951 };
952 
953 template <class F>
955  public:
956  explicit LssGetRevisionRequestWrapper(ev_exec_t* exec, F&& con)
957  : LssGetRevisionRequestBase(exec), con_(::std::forward<F>(con)) {}
958 
959  private:
960  void
961  operator()() noexcept final {
962  compat::invoke(::std::move(con_), ec, number);
963  delete this;
964  }
965 
966  typename ::std::decay<F>::type con_;
967 };
968 
969 template <class F>
971  public:
972  explicit LssGetSerialNrRequestWrapper(ev_exec_t* exec, F&& con)
973  : LssGetSerialNrRequestBase(exec), con_(::std::forward<F>(con)) {}
974 
975  private:
976  void
977  operator()() noexcept final {
978  compat::invoke(::std::move(con_), ec, number);
979  delete this;
980  }
981 
982  typename ::std::decay<F>::type con_;
983 };
984 
985 template <class F>
987  public:
988  explicit LssGetIdRequestWrapper(ev_exec_t* exec, F&& con)
989  : LssGetIdRequestBase(exec), con_(::std::forward<F>(con)) {}
990 
991  private:
992  void
993  operator()() noexcept final {
994  compat::invoke(::std::move(con_), ec, id);
995  delete this;
996  }
997 
998  typename ::std::decay<F>::type con_;
999 };
1000 
1001 template <class F>
1003  public:
1004  explicit LssIdNonConfigRequestWrapper(ev_exec_t* exec, F&& con)
1005  : LssIdNonConfigRequestBase(exec), con_(::std::forward<F>(con)) {}
1006 
1007  private:
1008  void
1009  operator()() noexcept final {
1010  bool found = !ec;
1011  // A timeout means no slave was found, but is otherwise not an error.
1012  if (ec == ::std::errc::timed_out) ec.clear();
1013  compat::invoke(::std::move(con_), ec, found);
1014  delete this;
1015  }
1016 
1017  typename ::std::decay<F>::type con_;
1018 };
1019 
1020 template <class F>
1022  public:
1023  explicit LssSlowscanRequestWrapper(ev_exec_t* exec, const LssAddress& lo,
1024  const LssAddress& hi, F&& con)
1025  : LssSlowscanRequestBase(exec), con_(::std::forward<F>(con)) {
1026  this->lo = lo;
1027  this->hi = hi;
1028  }
1029 
1030  private:
1031  void
1032  operator()() noexcept final {
1033  compat::invoke(::std::move(con_), ec, address);
1034  delete this;
1035  }
1036 
1037  typename ::std::decay<F>::type con_;
1038 };
1039 
1040 template <class F>
1042  public:
1043  explicit LssFastscanRequestWrapper(ev_exec_t* exec, const LssAddress& address,
1044  const LssAddress& mask, F&& con)
1045  : LssFastscanRequestBase(exec), con_(::std::forward<F>(con)) {
1046  this->address = address;
1047  this->mask = mask;
1048  }
1049 
1050  private:
1051  void
1052  operator()() noexcept final {
1053  compat::invoke(::std::move(con_), ec, address);
1054  delete this;
1055  }
1056 
1057  typename ::std::decay<F>::type con_;
1058 };
1059 
1060 } // namespace detail
1061 
1072 template <class F>
1073 // clang-format off
1074 inline typename ::std::enable_if<
1078  // clang-format on
1079  return new detail::LssSwitchRequestWrapper<F>(exec, state,
1080  ::std::forward<F>(con));
1081 }
1082 
1094 template <class F>
1095 inline typename ::std::enable_if<
1097  detail::LssSwitchSelectiveRequestWrapper<F>*>::type
1099  F&& con) {
1101  exec, address, ::std::forward<F>(con));
1102 }
1103 
1114 template <class F>
1115 // clang-format off
1116 inline typename ::std::enable_if<
1118  detail::LssSetIdRequestWrapper<F>*>::type
1119 make_lss_set_id_request(ev_exec_t* exec, uint8_t id, F&& con) {
1120  // clang-format on
1121  return new detail::LssSetIdRequestWrapper<F>(exec, id,
1122  ::std::forward<F>(con));
1123 }
1124 
1136 template <class F>
1137 // clang-format off
1138 inline typename ::std::enable_if<
1140  detail::LssSetBitrateRequestWrapper<F>*>::type
1141 make_lss_set_bitrate_request(ev_exec_t* exec, int bitrate, F&& con) {
1142  // clang-format on
1143  return new detail::LssSetBitrateRequestWrapper<F>(exec, bitrate,
1144  ::std::forward<F>(con));
1145 }
1146 
1158 template <class F>
1159 // clang-format off
1160 inline typename ::std::enable_if<
1162  detail::LssSwitchBitrateRequestWrapper<F>*>::type
1163 make_lss_switch_bitrate_request(ev_exec_t* exec, int delay, F&& con) {
1164  // clang-format on
1165  return new detail::LssSwitchBitrateRequestWrapper<F>(exec, delay,
1166  ::std::forward<F>(con));
1167 }
1168 
1178 template <class F>
1179 // clang-format off
1180 inline typename ::std::enable_if<
1182  detail::LssStoreRequestWrapper<F>*>::type
1184  // clang-format on
1185  return new detail::LssStoreRequestWrapper<F>(exec, ::std::forward<F>(con));
1186 }
1187 
1197 template <class F>
1198 inline typename ::std::enable_if<
1200  detail::LssGetVendorIdRequestWrapper<F>*>::type
1203  ::std::forward<F>(con));
1204 }
1205 
1215 template <class F>
1216 inline typename ::std::enable_if<
1218  detail::LssGetProductCodeRequestWrapper<F>*>::type
1221  ::std::forward<F>(con));
1222 }
1223 
1233 template <class F>
1234 inline typename ::std::enable_if<
1236  detail::LssGetRevisionRequestWrapper<F>*>::type
1239  ::std::forward<F>(con));
1240 }
1241 
1251 template <class F>
1252 inline typename ::std::enable_if<
1254  detail::LssGetSerialNrRequestWrapper<F>*>::type
1257  ::std::forward<F>(con));
1258 }
1259 
1269 template <class F>
1270 inline typename ::std::enable_if<
1272  detail::LssGetIdRequestWrapper<F>*>::type
1274  return new detail::LssGetIdRequestWrapper<F>(exec, ::std::forward<F>(con));
1275 }
1276 
1286 template <class F>
1287 // clang-format off
1288 inline typename ::std::enable_if<
1290  detail::LssIdNonConfigRequestWrapper<F>*>::type
1292  // clang-format on
1294  ::std::forward<F>(con));
1295 }
1296 
1309 template <class F>
1310 inline typename ::std::enable_if<
1312  detail::LssSlowscanRequestWrapper<F>*>::type
1314  const LssAddress& hi, F&& con) {
1315  return new detail::LssSlowscanRequestWrapper<F>(exec, lo, hi,
1316  ::std::forward<F>(con));
1317 }
1318 
1334 template <class F>
1335 inline typename ::std::enable_if<
1337  detail::LssFastscanRequestWrapper<F>*>::type
1339  const LssAddress& mask, F&& con) {
1340  return new detail::LssFastscanRequestWrapper<F>(exec, address, mask,
1341  ::std::forward<F>(con));
1342 }
1343 
1350 class LssMaster : protected util::BasicLockable {
1351  friend class detail::LssSwitchRequestBase;
1353  friend class detail::LssSetIdRequestBase;
1354  friend class detail::LssSetBitrateRequestBase;
1356  friend class detail::LssStoreRequestBase;
1357  friend class detail::LssGetVendorIdRequestBase;
1359  friend class detail::LssGetRevisionRequestBase;
1360  friend class detail::LssGetSerialNrRequestBase;
1361  friend class detail::LssGetIdRequestBase;
1362  friend class detail::LssIdNonConfigRequestBase;
1363  friend class detail::LssSlowscanRequestBase;
1364  friend class detail::LssFastscanRequestBase;
1365 
1366  public:
1376  explicit LssMaster(ev_exec_t* exec, Node& node,
1377  io::CanControllerBase* ctrl = nullptr);
1378 
1380  explicit LssMaster(Node& node, io::CanControllerBase* ctrl = nullptr)
1381  : LssMaster(nullptr, node, ctrl) {}
1382 
1383  LssMaster(const LssMaster&) = delete;
1384  LssMaster& operator=(const LssMaster&) = delete;
1385 
1386  virtual ~LssMaster();
1387 
1392  ev::Executor GetExecutor() const noexcept;
1393 
1395  Node& GetNode() const noexcept;
1396 
1401  io::CanControllerBase* GetController() const noexcept;
1402 
1404  ::std::chrono::microseconds GetInhibit() const;
1405 
1407  void SetInhibit(const ::std::chrono::microseconds& inhibit);
1408 
1414  ::std::chrono::milliseconds GetTimeout() const;
1415 
1421  void SetTimeout(const ::std::chrono::milliseconds& timeout);
1422 
1430  void
1431  SubmitSwitch(detail::LssSwitchRequestBase& req,
1432  LssState state = LssState::WAITING) {
1433  req.state = state;
1434  Submit(req);
1435  }
1436 
1446  template <class F>
1447  void
1448  SubmitSwitch(ev_exec_t* exec, LssState state, F&& con) {
1449  Submit(*make_lss_switch_request(exec, state, ::std::forward<F>(con)));
1450  }
1451 
1453  template <class F>
1454  void
1455  SubmitSwitch(LssState state, F&& con) {
1456  SubmitSwitch(nullptr, state, ::std::forward<F>(con));
1457  }
1458 
1460  bool
1462  return Cancel(req);
1463  }
1464 
1466  bool
1468  return Abort(req);
1469  }
1470 
1483  LssFuture<void> AsyncSwitch(ev_exec_t* exec,
1484  LssState state = LssState::WAITING,
1485  detail::LssSwitchRequestBase** preq = nullptr);
1486 
1490  detail::LssSwitchRequestBase** preq = nullptr) {
1491  return AsyncSwitch(nullptr, state, preq);
1492  }
1493 
1502  void
1504  const LssAddress& address) {
1505  req.address = address;
1506  Submit(req);
1507  }
1508 
1520  template <class F>
1521  void
1522  SubmitSwitchSelective(ev_exec_t* exec, const LssAddress& address, F&& con) {
1523  Submit(*make_lss_switch_selective_request(exec, address,
1524  ::std::forward<F>(con)));
1525  }
1526 
1528  template <class F>
1529  void
1530  SubmitSwitchSelective(const LssAddress& address, F&& con) {
1531  SubmitSwitchSelective(nullptr, address, ::std::forward<F>(con));
1532  }
1533 
1535  bool
1537  return Cancel(req);
1538  }
1539 
1541  bool
1543  return Abort(req);
1544  }
1545 
1559  LssFuture<void> AsyncSwitchSelective(
1560  ev_exec_t* exec, const LssAddress& address,
1561  detail::LssSwitchSelectiveRequestBase** preq = nullptr);
1562 
1566  detail::LssSwitchSelectiveRequestBase** preq = nullptr) {
1567  return AsyncSwitchSelective(nullptr, address, preq);
1568  }
1569 
1579  void
1581  req.id = id;
1582  Submit(req);
1583  }
1584 
1596  template <class F>
1597  void
1598  SubmitSetId(ev_exec_t* exec, uint8_t id, F&& con) {
1599  Submit(*make_lss_set_id_request(exec, id, ::std::forward<F>(con)));
1600  }
1601 
1603  template <class F>
1604  void
1605  SubmitSetId(uint8_t id, F&& con) {
1606  SubmitSetId(nullptr, id, ::std::forward<F>(con));
1607  }
1608 
1610  bool
1612  return Cancel(req);
1613  }
1614 
1616  bool
1618  return Abort(req);
1619  }
1620 
1635  LssFuture<void> AsyncSetId(ev_exec_t* exec, uint8_t id,
1636  detail::LssSetIdRequestBase** preq = nullptr);
1637 
1640  AsyncSetId(uint8_t id, detail::LssSetIdRequestBase** preq = nullptr) {
1641  return AsyncSetId(nullptr, id, preq);
1642  }
1643 
1654  void
1656  req.bitrate = bitrate;
1657  Submit(req);
1658  }
1659 
1672  template <class F>
1673  void
1674  SubmitSetBitrate(ev_exec_t* exec, int bitrate, F&& con) {
1675  Submit(
1676  *make_lss_set_bitrate_request(exec, bitrate, ::std::forward<F>(con)));
1677  }
1678 
1680  template <class F>
1681  void
1682  SubmitSetBitrate(int bitrate, F&& con) {
1683  SubmitSetBitrate(nullptr, bitrate, ::std::forward<F>(con));
1684  }
1685 
1687  bool
1689  return Cancel(req);
1690  }
1691 
1693  bool
1695  return Abort(req);
1696  }
1697 
1713  LssFuture<void> AsyncSetBitrate(
1714  ev_exec_t* exec, int bitrate,
1715  detail::LssSetBitrateRequestBase** preq = nullptr);
1716 
1719  AsyncSetBitrate(int bitrate,
1720  detail::LssSetBitrateRequestBase** preq = nullptr) {
1721  return AsyncSetBitrate(nullptr, bitrate, preq);
1722  }
1723 
1734  void
1736  req.delay = delay;
1737  Submit(req);
1738  }
1739 
1752  template <class F>
1753  void
1754  SubmitSwitchBitrate(ev_exec_t* exec, int delay, F&& con) {
1755  Submit(
1756  *make_lss_switch_bitrate_request(exec, delay, ::std::forward<F>(con)));
1757  }
1758 
1760  template <class F>
1761  void
1762  SubmitSwitchBitrate(int delay, F&& con) {
1763  SubmitSwitchBitrate(nullptr, delay, ::std::forward<F>(con));
1764  }
1765 
1767  bool
1769  return Cancel(req);
1770  }
1771 
1773  bool
1775  return Abort(req);
1776  }
1777 
1793  LssFuture<void> AsyncSwitchBitrate(
1794  ev_exec_t* exec, int delay,
1795  detail::LssSwitchBitrateRequestBase** preq = nullptr);
1796 
1800  detail::LssSwitchBitrateRequestBase** preq = nullptr) {
1801  return AsyncSwitchBitrate(nullptr, delay, preq);
1802  }
1803 
1810  void
1812  Submit(req);
1813  }
1814 
1825  template <class F>
1826  void
1827  SubmitStore(ev_exec_t* exec, F&& con) {
1828  Submit(*make_lss_store_request(exec, ::std::forward<F>(con)));
1829  }
1830 
1832  template <class F>
1833  void
1834  SubmitStore(F&& con) {
1835  SubmitStore(nullptr, ::std::forward<F>(con));
1836  }
1837 
1839  bool
1841  return Cancel(req);
1842  }
1843 
1845  bool
1847  return Abort(req);
1848  }
1849 
1863  LssFuture<void> AsyncStore(ev_exec_t* exec,
1864  detail::LssStoreRequestBase** preq = nullptr);
1865 
1869  return AsyncStore(nullptr, preq);
1870  }
1871 
1878  void
1880  Submit(req);
1881  }
1882 
1893  template <class F>
1894  void
1895  SubmitGetVendorId(ev_exec_t* exec, F&& con) {
1896  Submit(*make_lss_get_vendor_id_request(exec, ::std::forward<F>(con)));
1897  }
1898 
1900  template <class F>
1901  void
1903  SubmitGetVendorId(nullptr, ::std::forward<F>(con));
1904  }
1905 
1907  bool
1909  return Cancel(req);
1910  }
1911 
1913  bool
1915  return Abort(req);
1916  }
1917 
1931  LssFuture<uint32_t> AsyncGetVendorId(
1932  ev_exec_t* exec, detail::LssGetVendorIdRequestBase** preq = nullptr);
1933 
1937  return AsyncGetVendorId(nullptr, preq);
1938  }
1939 
1946  void
1948  Submit(req);
1949  }
1950 
1961  template <class F>
1962  void
1964  Submit(*make_lss_get_product_code_request(exec, ::std::forward<F>(con)));
1965  }
1966 
1968  template <class F>
1969  void
1971  SubmitGetProductCode(nullptr, ::std::forward<F>(con));
1972  }
1973 
1975  bool
1977  return Cancel(req);
1978  }
1979 
1981  bool
1983  return Abort(req);
1984  }
1985 
1999  LssFuture<uint32_t> AsyncGetProductCode(
2000  ev_exec_t* exec, detail::LssGetProductCodeRequestBase** preq = nullptr);
2001 
2005  return AsyncGetProductCode(nullptr, preq);
2006  }
2007 
2014  void
2016  Submit(req);
2017  }
2018 
2029  template <class F>
2030  void
2031  SubmitGetRevision(ev_exec_t* exec, F&& con) {
2032  Submit(*make_lss_get_revision_request(exec, ::std::forward<F>(con)));
2033  }
2034 
2036  template <class F>
2037  void
2039  SubmitGetRevision(nullptr, ::std::forward<F>(con));
2040  }
2041 
2043  bool
2045  return Cancel(req);
2046  }
2047 
2049  bool
2051  return Abort(req);
2052  }
2053 
2067  LssFuture<uint32_t> AsyncGetRevision(
2068  ev_exec_t* exec, detail::LssGetRevisionRequestBase** preq = nullptr);
2069 
2073  return AsyncGetRevision(nullptr, preq);
2074  }
2075 
2082  void
2084  Submit(req);
2085  }
2086 
2097  template <class F>
2098  void
2099  SubmitGetSerialNr(ev_exec_t* exec, F&& con) {
2100  Submit(*make_lss_get_serial_nr_request(exec, ::std::forward<F>(con)));
2101  }
2102 
2104  template <class F>
2105  void
2107  SubmitGetSerialNr(nullptr, ::std::forward<F>(con));
2108  }
2109 
2111  bool
2113  return Cancel(req);
2114  }
2115 
2117  bool
2119  return Abort(req);
2120  }
2121 
2135  LssFuture<uint32_t> AsyncGetSerialNr(
2136  ev_exec_t* exec, detail::LssGetSerialNrRequestBase** preq = nullptr);
2137 
2141  return AsyncGetSerialNr(nullptr, preq);
2142  }
2143 
2149  void
2151  Submit(req);
2152  }
2153 
2164  template <class F>
2165  void
2166  SubmitGetId(ev_exec_t* exec, F&& con) {
2167  Submit(*make_lss_get_id_request(exec, ::std::forward<F>(con)));
2168  }
2169 
2171  template <class F>
2172  void
2173  SubmitGetId(F&& con) {
2174  SubmitGetId(nullptr, ::std::forward<F>(con));
2175  }
2176 
2178  bool
2180  return Cancel(req);
2181  }
2182 
2184  bool
2186  return Abort(req);
2187  }
2188 
2202  LssFuture<uint8_t> AsyncGetId(ev_exec_t* exec,
2203  detail::LssGetIdRequestBase** preq = nullptr);
2204 
2208  return AsyncGetId(nullptr, preq);
2209  }
2210 
2216  void
2218  Submit(req);
2219  }
2220 
2230  template <class F>
2231  void
2232  SubmitIdNonConfig(ev_exec_t* exec, F&& con) {
2233  Submit(*make_lss_id_non_config_request(exec, ::std::forward<F>(con)));
2234  }
2235 
2237  template <class F>
2238  void
2240  SubmitIdNonConfig(nullptr, ::std::forward<F>(con));
2241  }
2242 
2248  bool
2250  return Cancel(req);
2251  }
2252 
2254  bool
2256  return Abort(req);
2257  }
2258 
2271  LssFuture<bool> AsyncIdNonConfig(
2272  ev_exec_t* exec, detail::LssIdNonConfigRequestBase** preq = nullptr);
2273 
2277  return AsyncIdNonConfig(nullptr, preq);
2278  }
2279 
2290  void
2292  const LssAddress& hi) {
2293  req.lo = lo;
2294  req.hi = hi;
2295  Submit(req);
2296  }
2297 
2311  template <class F>
2312  void
2313  SubmitSlowscan(ev_exec_t* exec, const LssAddress& lo, const LssAddress& hi,
2314  F&& con) {
2315  Submit(*make_lss_slowscan_request(exec, lo, hi, ::std::forward<F>(con)));
2316  }
2317 
2319  template <class F>
2320  void
2321  SubmitSlowscan(F&& con) {
2322  SubmitSlowscan(nullptr, ::std::forward<F>(con));
2323  }
2324 
2326  bool
2328  return Cancel(req);
2329  }
2330 
2332  bool
2334  return Abort(req);
2335  }
2336 
2352  LssFuture<LssAddress> AsyncSlowscan(
2353  ev_exec_t* exec, const LssAddress& lo, const LssAddress& hi,
2354  detail::LssSlowscanRequestBase** preq = nullptr);
2355 
2358  AsyncSlowscan(const LssAddress& lo, const LssAddress& hi,
2359  detail::LssSlowscanRequestBase** preq = nullptr) {
2360  return AsyncSlowscan(nullptr, lo, hi, preq);
2361  }
2362 
2376  void
2378  const LssAddress& mask) {
2379  req.address = address;
2380  req.mask = mask;
2381  Submit(req);
2382  }
2383 
2399  template <class F>
2400  void
2401  SubmitFastscan(ev_exec_t* exec, const LssAddress& address,
2402  const LssAddress& mask, F&& con) {
2403  Submit(*make_lss_fastscan_request(exec, address, mask,
2404  ::std::forward<F>(con)));
2405  }
2406 
2408  template <class F>
2409  void
2410  SubmitFastscan(F&& con) {
2411  SubmitFastscan(nullptr, ::std::forward<F>(con));
2412  }
2413 
2415  bool
2417  return Cancel(req);
2418  }
2419 
2421  bool
2423  return Abort(req);
2424  }
2425 
2444  LssFuture<LssAddress> AsyncFastscan(
2445  ev_exec_t* exec, const LssAddress& address = {0, 0, 0, 0},
2446  const LssAddress& mask = {0, 0, 0, 0},
2447  detail::LssFastscanRequestBase** preq = nullptr);
2448 
2450  LssFuture<LssAddress>
2451  AsyncFastscan(const LssAddress& address = {0, 0, 0, 0},
2452  const LssAddress& mask = {0, 0, 0, 0},
2453  detail::LssFastscanRequestBase** preq = nullptr) {
2454  return AsyncFastscan(nullptr, address, mask, preq);
2455  }
2456 
2458  void Submit(detail::LssRequestBase& req);
2459 
2467  bool Cancel(detail::LssRequestBase& req);
2468 
2476  ::std::size_t CancelAll();
2477 
2485  bool Abort(detail::LssRequestBase& req);
2486 
2493  ::std::size_t AbortAll();
2494 
2506  virtual void
2507  OnStart(::std::function<void(::std::error_code ec)> res) noexcept {
2508  res(::std::error_code{});
2509  }
2510 
2529  virtual void OnSwitchBitrate(
2530  int bitrate, ::std::chrono::milliseconds delay,
2531  ::std::function<void(::std::error_code ec)> res) noexcept;
2532 
2533  protected:
2534  void lock() final;
2535  void unlock() final;
2536 
2541  void SetTime();
2542 
2543  private:
2544  struct Impl_;
2545  ::std::unique_ptr<Impl_> impl_;
2546 };
2547 
2548 } // namespace canopen
2549 
2550 } // namespace lely
2551 
2552 #endif // LELY_COAPP_LSS_MASTER_HPP_
lely::canopen::LssGetSerialNrRequest
An LSS 'inquire identity serial-number' request.
Definition: lss_master.hpp:625
lely::canopen::LssGetProductCodeRequest::LssGetProductCodeRequest
LssGetProductCodeRequest(F &&con)
Equivalent to LssGetProductCodeRequest(nullptr, con).
Definition: lss_master.hpp:575
lely::canopen::LssState::WAITING
@ WAITING
The state in which a slave may be identified.
lely::canopen::LssGetVendorIdRequest
An LSS 'inquire identity vendor-ID' request.
Definition: lss_master.hpp:513
lely::canopen::detail::LssSwitchSelectiveRequestBase
Definition: lss_master.hpp:134
lely::canopen::LssSwitchSelectiveRequest
An LSS 'switch state selective' request.
Definition: lss_master.hpp:332
lely::canopen::detail::LssGetIdRequestBase
Definition: lss_master.hpp:232
lely::canopen::LssMaster::SubmitSwitchSelective
void SubmitSwitchSelective(const LssAddress &address, F &&con)
Equivalent to SubmitSwitchSelective(nullptr, state, con).
Definition: lss_master.hpp:1530
lely::util::BasicLockable
An abstract interface conforming to the BasicLockable concept.
Definition: mutex.hpp:34
lely::canopen::LssMaster::CancelSetId
bool CancelSetId(detail::LssSetIdRequestBase &req)
Cancels an LSS 'configure node-ID' request.
Definition: lss_master.hpp:1611
lely::canopen::LssSwitchBitrateRequest
An LSS 'activate bit timing parameters' request.
Definition: lss_master.hpp:441
lely::canopen::LssMaster::SubmitGetSerialNr
void SubmitGetSerialNr(detail::LssGetSerialNrRequestBase &req)
Queues an LSS 'inquire identity serial-number' request.
Definition: lss_master.hpp:2083
ev_exec_t
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
Definition: ev.h:29
lely::canopen::LssMaster::SubmitFastscan
void SubmitFastscan(ev_exec_t *exec, const LssAddress &address, const LssAddress &mask, F &&con)
Creates and queues an 'LSS Fastscan' request.
Definition: lss_master.hpp:2401
lely::canopen::LssMaster::OnStart
virtual void OnStart(::std::function< void(::std::error_code ec)> res) noexcept
The function invoked when the LSS master services are executed during the NMT startup process.
Definition: lss_master.hpp:2507
lely::canopen::LssSwitchRequest::LssSwitchRequest
LssSwitchRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'switch state global' request with a completion task.
Definition: lss_master.hpp:314
lely::canopen::detail::LssSetBitrateRequestWrapper
Definition: lss_master.hpp:870
lely::canopen::detail::LssGetIdRequestWrapper
Definition: lss_master.hpp:986
lely::canopen::LssSetIdRequest::Signature
void(::std::error_code ec) Signature
The signature of the callback function invoked on completion of an LSS 'configure node-ID' request.
Definition: lss_master.hpp:379
lely::canopen::detail::LssSlowscanRequestBase::lo
LssAddress lo
The lower bound of the LSS address of the slave device.
Definition: lss_master.hpp:267
lely::canopen::LssMaster::CancelSwitchBitrate
bool CancelSwitchBitrate(detail::LssSwitchBitrateRequestBase &req)
Cancels an LSS 'activate bit timing parameters' request.
Definition: lss_master.hpp:1768
lely::canopen::LssMaster::AsyncSetBitrate
LssFuture< void > AsyncSetBitrate(int bitrate, detail::LssSetBitrateRequestBase **preq=nullptr)
Equivalent to AsyncSetBitrate(nullptr, id, preq).
Definition: lss_master.hpp:1719
lely::canopen::detail::LssSetIdRequestBase::id
uint8_t id
The requested pending node-ID of the LSS slave device.
Definition: lss_master.hpp:153
lely::canopen::LssMaster::AsyncIdNonConfig
LssFuture< bool > AsyncIdNonConfig(detail::LssIdNonConfigRequestBase **preq=nullptr)
Equivalent to AsyncIdNonConfig(nullptr, preq).
Definition: lss_master.hpp:2276
lely::canopen::LssMaster::CancelIdNonConfig
bool CancelIdNonConfig(detail::LssIdNonConfigRequestBase &req)
Cancels an LSS 'identify non-configured remote slave' request.
Definition: lss_master.hpp:2249
lely::canopen::LssMaster::CancelStore
bool CancelStore(detail::LssStoreRequestBase &req)
Cancels an LSS 'store configuration' request.
Definition: lss_master.hpp:1840
lely::canopen::detail::LssStoreRequestBase
Definition: lss_master.hpp:184
lely::canopen::detail::LssScanRequestBase
Definition: lss_master.hpp:251
lely::canopen::LssStoreRequest::LssStoreRequest
LssStoreRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'store configuration' request with a completion task.
Definition: lss_master.hpp:495
lely::canopen::LssGetVendorIdRequest::LssGetVendorIdRequest
LssGetVendorIdRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'store configuration' request with a completion task.
Definition: lss_master.hpp:532
lely::canopen::LssGetProductCodeRequest
An LSS 'inquire identity product-code' request.
Definition: lss_master.hpp:550
lely::canopen::LssSwitchSelectiveRequest::LssSwitchSelectiveRequest
LssSwitchSelectiveRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'switch state selective' request with a completion task.
Definition: lss_master.hpp:350
lely::canopen::LssMaster::SubmitSetBitrate
void SubmitSetBitrate(ev_exec_t *exec, int bitrate, F &&con)
Creates and queues an LSS 'configure bit timing parameters' request.
Definition: lss_master.hpp:1674
lely::canopen::detail::LssSwitchBitrateRequestWrapper
Definition: lss_master.hpp:888
lely::ev::Promise
A promise.
Definition: future.hpp:60
lely::canopen::detail::LssRequestBase::ec
::std::error_code ec
The error code (0 on success).
Definition: lss_master.hpp:115
lely::canopen::make_lss_get_serial_nr_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, uint32_t >::value, detail::LssGetSerialNrRequestWrapper< F > * >::type make_lss_get_serial_nr_request(ev_exec_t *exec, F &&con)
Creates an LSS 'inquire identity serial-number' request with a completion task.
Definition: lss_master.hpp:1255
lely::canopen::LssMaster::AbortFastscan
bool AbortFastscan(detail::LssFastscanRequestBase &req)
Aborts an 'LSS Fastscan' request.
Definition: lss_master.hpp:2422
lely::canopen::LssMaster::SubmitIdNonConfig
void SubmitIdNonConfig(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'identify non-configured remote slave' request.
Definition: lss_master.hpp:2232
lely::canopen::LssFastscanRequest
An 'LSS Fastscan' request.
Definition: lss_master.hpp:775
type_traits.hpp
node.hpp
lely::canopen::LssMaster::SubmitStore
void SubmitStore(F &&con)
Equivalent to SubmitStore(nullptr, con).
Definition: lss_master.hpp:1834
lely::canopen::LssSwitchSelectiveRequest::Signature
void(::std::error_code ec) Signature
The signature of the callback function invoked on completion of an LSS 'switch state selective' reque...
Definition: lss_master.hpp:342
lely::canopen::LssMaster::CancelGetProductCode
bool CancelGetProductCode(detail::LssGetProductCodeRequestBase &req)
Cancels an LSS 'inquire identity product-code' request.
Definition: lss_master.hpp:1976
lely::canopen::LssIdNonConfigRequest::LssIdNonConfigRequest
LssIdNonConfigRequest(F &&con)
Equivalent to LssIdNonConfigRequest(nullptr, con).
Definition: lss_master.hpp:722
lely::canopen::make_lss_set_id_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::LssSetIdRequestWrapper< F > * >::type make_lss_set_id_request(ev_exec_t *exec, uint8_t id, F &&con)
Creates an LSS 'configure node-ID' request with a completion task.
Definition: lss_master.hpp:1119
lely::canopen::LssMaster::SubmitSetBitrate
void SubmitSetBitrate(detail::LssSetBitrateRequestBase &req, int bitrate)
Queues an LSS 'configure bit timing parameters' request.
Definition: lss_master.hpp:1655
lely::canopen::LssGetIdRequest
An LSS 'inquire node-ID' request.
Definition: lss_master.hpp:662
lely::canopen::make_lss_get_revision_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, uint32_t >::value, detail::LssGetRevisionRequestWrapper< F > * >::type make_lss_get_revision_request(ev_exec_t *exec, F &&con)
Creates an LSS 'inquire identity revision-number' request with a completion task.
Definition: lss_master.hpp:1237
lely::canopen::LssMaster::CancelGetVendorId
bool CancelGetVendorId(detail::LssGetVendorIdRequestBase &req)
Cancels an LSS 'inquire identity vendor-ID' request.
Definition: lss_master.hpp:1908
lely::canopen::LssMaster::AsyncGetId
LssFuture< uint8_t > AsyncGetId(detail::LssGetIdRequestBase **preq=nullptr)
Equivalent to AsyncGetId(nullptr, preq).
Definition: lss_master.hpp:2207
lely::canopen::LssMaster::AbortSwitchSelective
bool AbortSwitchSelective(detail::LssSwitchSelectiveRequestBase &req)
Aborts an LSS 'switch state selective' request.
Definition: lss_master.hpp:1542
lely::canopen::LssGetRevisionRequest::LssGetRevisionRequest
LssGetRevisionRequest(F &&con)
Equivalent to LssGetRevisionRequest(nullptr, con).
Definition: lss_master.hpp:612
lely::canopen::LssSwitchRequest
An LSS 'switch state global' request.
Definition: lss_master.hpp:296
lely::canopen::LssMaster::SubmitSwitch
void SubmitSwitch(ev_exec_t *exec, LssState state, F &&con)
Creates and queues an LSS 'switch state global' request.
Definition: lss_master.hpp:1448
lely::canopen::make_lss_get_id_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, uint8_t >::value, detail::LssGetIdRequestWrapper< F > * >::type make_lss_get_id_request(ev_exec_t *exec, F &&con)
Creates an LSS 'inquire node-ID' request with a completion task.
Definition: lss_master.hpp:1273
lely::canopen::detail::LssIdNonConfigRequestBase
Definition: lss_master.hpp:243
lely::canopen::LssGetRevisionRequest::Signature
void(::std::error_code ec, uint32_t number) Signature
The signature of the callback function invoked on completion of an LSS 'inquire identity revision-num...
Definition: lss_master.hpp:600
lely::canopen::LssSetBitrateRequest
An LSS 'configure bit timing parameters' request.
Definition: lss_master.hpp:405
lely::canopen::detail::LssSwitchBitrateRequestBase
Definition: lss_master.hpp:170
lely::canopen::LssGetProductCodeRequest::Signature
void(::std::error_code ec, uint32_t number) Signature
The signature of the callback function invoked on completion of an LSS 'inquire identity product-code...
Definition: lss_master.hpp:562
lely::canopen::LssSwitchBitrateRequest::LssSwitchBitrateRequest
LssSwitchBitrateRequest(F &&con)
Equivalent to LssSwitchBitrateRequest(nullptr, con).
Definition: lss_master.hpp:465
lely::canopen::LssMaster::CancelGetId
bool CancelGetId(detail::LssGetIdRequestBase &req)
Cancels an LSS 'inquire node-ID' request.
Definition: lss_master.hpp:2179
lely::canopen::LssGetVendorIdRequest::LssGetVendorIdRequest
LssGetVendorIdRequest(F &&con)
Equivalent to LssGetVendorIdRequest(nullptr, con).
Definition: lss_master.hpp:537
lely::canopen::make_lss_slowscan_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, LssAddress >::value, detail::LssSlowscanRequestWrapper< F > * >::type make_lss_slowscan_request(ev_exec_t *exec, const LssAddress &lo, const LssAddress &hi, F &&con)
Creates an 'LSS Slowscan' request with a completion task.
Definition: lss_master.hpp:1313
lely::canopen::LssMaster::AsyncSwitchBitrate
LssFuture< void > AsyncSwitchBitrate(int delay, detail::LssSwitchBitrateRequestBase **preq=nullptr)
Equivalent to AsyncSwitchBitrate(nullptr, id, preq).
Definition: lss_master.hpp:1799
lely::canopen::LssMaster::AbortIdNonConfig
bool AbortIdNonConfig(detail::LssIdNonConfigRequestBase &req)
Aborts an LSS 'identify non-configured remote slave' request.
Definition: lss_master.hpp:2255
lely::canopen::LssMaster::SubmitGetSerialNr
void SubmitGetSerialNr(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'inquire identity serial-number' request.
Definition: lss_master.hpp:2099
lely::canopen::LssSetIdRequest::LssSetIdRequest
LssSetIdRequest(F &&con)
Equivalent to LssSetIdRequest(nullptr, con).
Definition: lss_master.hpp:392
lely::canopen::LssIdNonConfigRequest
An LSS 'identify non-configured remote slave' request.
Definition: lss_master.hpp:698
lely::canopen::detail::LssScanRequestBase::address
LssAddress address
On success, the LSS address of the detected slave device.
Definition: lss_master.hpp:259
lely::canopen::LssMaster::AsyncGetRevision
LssFuture< uint32_t > AsyncGetRevision(detail::LssGetRevisionRequestBase **preq=nullptr)
Equivalent to AsyncGetRevision(nullptr, preq).
Definition: lss_master.hpp:2072
lely::canopen::detail::LssGetRevisionRequestBase
Definition: lss_master.hpp:216
lely::canopen::LssMaster::AbortSwitch
bool AbortSwitch(detail::LssSwitchRequestBase &req)
Aborts an LSS 'switch state global' request.
Definition: lss_master.hpp:1467
lely::canopen::LssGetIdRequest::Signature
void(::std::error_code ec, uint8_t id) Signature
The signature of the callback function invoked on completion of an LSS 'inquire node-ID' request.
Definition: lss_master.hpp:673
lely::canopen::LssGetRevisionRequest::LssGetRevisionRequest
LssGetRevisionRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'store configuration' request with a completion task.
Definition: lss_master.hpp:607
lely::canopen::detail::LssRequestBase::GetExecutor
ev::Executor GetExecutor() const noexcept
Returns the executor to which the completion task is (to be) submitted.
Definition: lss_master.hpp:110
lely::canopen::LssGetVendorIdRequest::Signature
void(::std::error_code ec, uint32_t number) Signature
The signature of the callback function invoked on completion of an LSS 'inquire identity vendor-ID' r...
Definition: lss_master.hpp:525
lely::canopen::LssMaster::SubmitSlowscan
void SubmitSlowscan(F &&con)
Equivalent to SubmitSlowscan(nullptr, con).
Definition: lss_master.hpp:2321
lely::canopen::LssMaster::SubmitGetSerialNr
void SubmitGetSerialNr(F &&con)
Equivalent to SubmitGetSerialNr(nullptr, con).
Definition: lss_master.hpp:2106
lely::canopen::LssAddress::product_code
uint32_t product_code
THe product code.
Definition: lss_master.hpp:72
lely::canopen::LssAddress::revision
uint32_t revision
The revision number.
Definition: lss_master.hpp:74
lely::canopen::LssMaster::SubmitFastscan
void SubmitFastscan(detail::LssFastscanRequestBase &req, const LssAddress &address, const LssAddress &mask)
Queues an 'LSS Fastscan' request.
Definition: lss_master.hpp:2377
lely::canopen::LssMaster::CancelSwitch
bool CancelSwitch(detail::LssSwitchRequestBase &req)
Cancels an LSS 'switch state global' request.
Definition: lss_master.hpp:1461
lely::canopen::LssMaster::CancelSlowscan
bool CancelSlowscan(detail::LssSlowscanRequestBase &req)
Cancels an 'LSS Slowscan' request.
Definition: lss_master.hpp:2327
lely::canopen::LssMaster::SubmitIdNonConfig
void SubmitIdNonConfig(F &&con)
Equivalent to SubmitIdNonConfig(nullptr, con).
Definition: lss_master.hpp:2239
lely::canopen::LssGetRevisionRequest
An LSS 'inquire identity revision-number' request.
Definition: lss_master.hpp:588
lely::canopen::detail::LssGetProductCodeRequestBase
Definition: lss_master.hpp:208
lely::canopen::LssMaster::SubmitSetId
void SubmitSetId(ev_exec_t *exec, uint8_t id, F &&con)
Creates and queues an LSS 'configure node-ID' request.
Definition: lss_master.hpp:1598
lely::canopen::LssMaster::LssMaster
LssMaster(Node &node, io::CanControllerBase *ctrl=nullptr)
Creates a new CANopen LSS master.
Definition: lss_master.hpp:1380
lely::canopen::make_lss_get_product_code_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, uint32_t >::value, detail::LssGetProductCodeRequestWrapper< F > * >::type make_lss_get_product_code_request(ev_exec_t *exec, F &&con)
Creates an LSS 'inquire identity product-code' request with a completion task.
Definition: lss_master.hpp:1219
lely::canopen::LssMaster::SubmitGetId
void SubmitGetId(detail::LssGetIdRequestBase &req)
Queues an LSS 'inquire node-ID' request.
Definition: lss_master.hpp:2150
lely::canopen::LssMaster::CancelSwitchSelective
bool CancelSwitchSelective(detail::LssSwitchSelectiveRequestBase &req)
Cancels an LSS 'switch state selective' request.
Definition: lss_master.hpp:1536
lely::canopen::LssMaster::AbortSlowscan
bool AbortSlowscan(detail::LssSlowscanRequestBase &req)
Aborts an 'LSS Slowscan' request.
Definition: lss_master.hpp:2333
lely::canopen::detail::LssGetVendorIdRequestBase
Definition: lss_master.hpp:200
lely::canopen::LssMaster::CancelGetRevision
bool CancelGetRevision(detail::LssGetRevisionRequestBase &req)
Cancels an LSS 'inquire identity revision-number' request.
Definition: lss_master.hpp:2044
lely::canopen::LssGetSerialNrRequest::LssGetSerialNrRequest
LssGetSerialNrRequest(F &&con)
Equivalent to LssGetSerialNrRequest(nullptr, con).
Definition: lss_master.hpp:649
lely::canopen::LssSlowscanRequest::LssSlowscanRequest
LssSlowscanRequest(ev_exec_t *exec, F &&con)
Constructs an empty 'LSS Slowscan' request with a completion task.
Definition: lss_master.hpp:757
lely::canopen::LssStoreRequest::LssStoreRequest
LssStoreRequest(F &&con)
Equivalent to LssStoreRequest(nullptr, con).
Definition: lss_master.hpp:500
lely::canopen::detail::LssSlowscanRequestBase
Definition: lss_master.hpp:262
lely::canopen::LssMaster::AsyncSwitchSelective
LssFuture< void > AsyncSwitchSelective(const LssAddress &address, detail::LssSwitchSelectiveRequestBase **preq=nullptr)
Equivalent to AsyncSwitchSelective(nullptr, address, preq).
Definition: lss_master.hpp:1565
lely::ev::Executor
An abstract task executor. This class is a wrapper around #ev_exec_t*.
Definition: exec.hpp:38
lely::canopen::LssMaster::AbortGetSerialNr
bool AbortGetSerialNr(detail::LssGetSerialNrRequestBase &req)
Aborts an LSS 'inquire identity serial-number' request.
Definition: lss_master.hpp:2118
lely::canopen::LssFastscanRequest::LssFastscanRequest
LssFastscanRequest(F &&con)
Equivalent to LssSlowscanRequest(nullptr, con).
Definition: lss_master.hpp:800
lely::compat::is_invocable
Determines whether F can be invoked with the arguments Args....
Definition: type_traits.hpp:206
lely::canopen::detail::LssSwitchRequestBase
Definition: lss_master.hpp:123
lely::canopen::LssGetSerialNrRequest::Signature
void(::std::error_code ec, uint32_t number) Signature
The signature of the callback function invoked on completion of an LSS 'inquire identity serial-numbe...
Definition: lss_master.hpp:637
functional.hpp
lely::canopen::LssMaster::SubmitGetRevision
void SubmitGetRevision(detail::LssGetRevisionRequestBase &req)
Queues an LSS 'inquire identity revision-number' request.
Definition: lss_master.hpp:2015
lely::canopen::LssMaster::CancelSetBitrate
bool CancelSetBitrate(detail::LssSetBitrateRequestBase &req)
Cancels an LSS 'configure bit timing parameters' request.
Definition: lss_master.hpp:1688
lely::canopen::LssSwitchBitrateRequest::LssSwitchBitrateRequest
LssSwitchBitrateRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'activate bit timing parameters' request with a completion task.
Definition: lss_master.hpp:459
lely::canopen::detail::LssGetProductCodeRequestWrapper
Definition: lss_master.hpp:938
lely::ev::Future
A future.
Definition: future.hpp:50
lely::canopen::LssFastscanRequest::LssFastscanRequest
LssFastscanRequest(ev_exec_t *exec, F &&con)
Constructs an empty 'LSS Fastscan' request with a completion task.
Definition: lss_master.hpp:795
lely::canopen::detail::LssGetVendorIdRequestWrapper
Definition: lss_master.hpp:922
lely::canopen::LssFastscanRequest::Signature
void(::std::error_code ec, LssAddress address) Signature
The signature of the callback function invoked on completion of an 'LSS Fastscan' request.
Definition: lss_master.hpp:786
lely::canopen::detail::LssSlowscanRequestBase::hi
LssAddress hi
The upper bound of the LSS address of the slave device.
Definition: lss_master.hpp:272
lely::canopen::LssSwitchRequest::LssSwitchRequest
LssSwitchRequest(F &&con)
Equivalent to LssSwitchRequest(nullptr, con).
Definition: lss_master.hpp:319
lely::canopen::LssSetBitrateRequest::LssSetBitrateRequest
LssSetBitrateRequest(F &&con)
Equivalent to LssSetBitrateRequest(nullptr, con).
Definition: lss_master.hpp:428
lely::canopen::detail::LssSlowscanRequestWrapper
Definition: lss_master.hpp:1021
lely::canopen::LssGetSerialNrRequest::LssGetSerialNrRequest
LssGetSerialNrRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'store configuration' request with a completion task.
Definition: lss_master.hpp:644
lely::canopen::LssMaster::SubmitSwitchBitrate
void SubmitSwitchBitrate(ev_exec_t *exec, int delay, F &&con)
Creates and queues an LSS 'activate bit timing parameters' request.
Definition: lss_master.hpp:1754
lely::canopen::detail::LssGetSerialNrRequestBase
Definition: lss_master.hpp:224
lely::canopen::LssMaster::AsyncSetId
LssFuture< void > AsyncSetId(uint8_t id, detail::LssSetIdRequestBase **preq=nullptr)
Equivalent to AsyncSetId(nullptr, id, preq).
Definition: lss_master.hpp:1640
lely::canopen::make_lss_set_bitrate_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::LssSetBitrateRequestWrapper< F > * >::type make_lss_set_bitrate_request(ev_exec_t *exec, int bitrate, F &&con)
Creates an LSS 'configure bit timing parameters' request with a completion task.
Definition: lss_master.hpp:1141
lely::canopen::LssMaster::SubmitStore
void SubmitStore(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'store configuration' request.
Definition: lss_master.hpp:1827
lely::canopen::LssAddress::serial_nr
uint32_t serial_nr
THe serial number.
Definition: lss_master.hpp:76
lely::canopen::detail::LssSwitchSelectiveRequestBase::address
LssAddress address
The address of the LSS slave device to be switched into the configuration state.
Definition: lss_master.hpp:142
lely::canopen::LssMaster::AsyncStore
LssFuture< void > AsyncStore(detail::LssStoreRequestBase **preq=nullptr)
Equivalent to AsyncStore(nullptr, preq).
Definition: lss_master.hpp:1868
lely::canopen::detail::LssGetRevisionRequestWrapper
Definition: lss_master.hpp:954
lely::canopen::make_lss_get_vendor_id_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, uint32_t >::value, detail::LssGetVendorIdRequestWrapper< F > * >::type make_lss_get_vendor_id_request(ev_exec_t *exec, F &&con)
Creates an LSS 'inquire identity vendor-ID' request with a completion task.
Definition: lss_master.hpp:1201
lely::canopen::make_lss_fastscan_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, LssAddress >::value, detail::LssFastscanRequestWrapper< F > * >::type make_lss_fastscan_request(ev_exec_t *exec, const LssAddress &address, const LssAddress &mask, F &&con)
Creates an 'LSS Fastscan' request with a completion task.
Definition: lss_master.hpp:1338
lely::canopen::LssMaster::AbortGetProductCode
bool AbortGetProductCode(detail::LssGetProductCodeRequestBase &req)
Aborts an LSS 'inquire identity product-code' request.
Definition: lss_master.hpp:1982
lely::canopen::detail::LssFastscanRequestBase::mask
LssAddress mask
A mask specifying which bits in the LSS address of the slave device are already known and can be skip...
Definition: lss_master.hpp:287
lely::canopen::LssMaster::AbortGetVendorId
bool AbortGetVendorId(detail::LssGetVendorIdRequestBase &req)
Aborts an LSS 'inquire identity vendor-ID' request.
Definition: lss_master.hpp:1914
lely::canopen::LssMaster::SubmitSwitchSelective
void SubmitSwitchSelective(ev_exec_t *exec, const LssAddress &address, F &&con)
Creates and queues an LSS 'switch state selective' request.
Definition: lss_master.hpp:1522
lely::canopen::make_lss_store_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::LssStoreRequestWrapper< F > * >::type make_lss_store_request(ev_exec_t *exec, F &&con)
Creates an LSS 'store configuration' request with a completion task.
Definition: lss_master.hpp:1183
lely::canopen::LssMaster::SubmitSetId
void SubmitSetId(detail::LssSetIdRequestBase &req, uint8_t id)
Queues an LSS 'configure node-ID' request.
Definition: lss_master.hpp:1580
lely::canopen::LssSwitchBitrateRequest::Signature
void(::std::error_code ec) Signature
The signature of the callback function invoked on completion of an LSS 'activate bit timing parameter...
Definition: lss_master.hpp:451
lely::canopen::LssMaster::AbortSetId
bool AbortSetId(detail::LssSetIdRequestBase &req)
Aborts an LSS 'configure node-ID' request.
Definition: lss_master.hpp:1617
lely::canopen::LssMaster::SubmitGetVendorId
void SubmitGetVendorId(detail::LssGetVendorIdRequestBase &req)
Queues an LSS 'inquire identity vendor-ID' request.
Definition: lss_master.hpp:1879
lely::canopen::Node
The base class for CANopen nodes.
Definition: node.hpp:116
lely::canopen::detail::LssStoreRequestWrapper
Definition: lss_master.hpp:906
lely::canopen::LssMaster::SubmitGetId
void SubmitGetId(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'inquire node-ID' request.
Definition: lss_master.hpp:2166
lely::canopen::LssMaster::CancelGetSerialNr
bool CancelGetSerialNr(detail::LssGetSerialNrRequestBase &req)
Cancels an LSS 'inquire identity serial-number' request.
Definition: lss_master.hpp:2112
lely::canopen::detail::LssFastscanRequestBase
Definition: lss_master.hpp:278
lely::canopen::make_lss_switch_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::LssSwitchRequestWrapper< F > * >::type make_lss_switch_request(ev_exec_t *exec, LssState state, F &&con)
Creates an LSS 'switch state global' request with a completion task.
Definition: lss_master.hpp:1077
lely::canopen::LssMaster::AsyncSwitch
LssFuture< void > AsyncSwitch(LssState state=LssState::WAITING, detail::LssSwitchRequestBase **preq=nullptr)
Equivalent to AsyncSwitch(nullptr, state, preq).
Definition: lss_master.hpp:1489
lely::canopen::LssMaster::SubmitFastscan
void SubmitFastscan(F &&con)
Equivalent to SubmitFastscan(nullptr, con).
Definition: lss_master.hpp:2410
lely::canopen::LssState::CONFIG
@ CONFIG
The state in which the node-ID and bit timing parameters of a slave may be configured.
lely::canopen::LssMaster::AsyncGetProductCode
LssFuture< uint32_t > AsyncGetProductCode(detail::LssGetProductCodeRequestBase **preq=nullptr)
Equivalent to AsyncGetProductCode(nullptr, preq).
Definition: lss_master.hpp:2004
lely::canopen::LssMaster::SubmitGetVendorId
void SubmitGetVendorId(F &&con)
Equivalent to SubmitGetVendorId(nullptr, con).
Definition: lss_master.hpp:1902
lely::canopen::LssAddress::vendor_id
uint32_t vendor_id
The vendor-ID.
Definition: lss_master.hpp:70
lely::canopen::LssSwitchSelectiveRequest::LssSwitchSelectiveRequest
LssSwitchSelectiveRequest(F &&con)
Equivalent to LssSwitchSelectiveRequest(nullptr, con).
Definition: lss_master.hpp:356
lely::canopen::LssSetIdRequest::LssSetIdRequest
LssSetIdRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'configure node-ID' request with a completion task.
Definition: lss_master.hpp:387
lely::canopen::LssState
LssState
The states of the LSS finite state automaton (FSA) of a slave device.
Definition: lss_master.hpp:80
lely::canopen::LssGetProductCodeRequest::LssGetProductCodeRequest
LssGetProductCodeRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'store configuration' request with a completion task.
Definition: lss_master.hpp:569
lely::canopen::LssMaster::AbortSetBitrate
bool AbortSetBitrate(detail::LssSetBitrateRequestBase &req)
Aborts an LSS 'configure bit timing parameters' request.
Definition: lss_master.hpp:1694
lely::canopen::LssStoreRequest::Signature
void(::std::error_code ec) Signature
The signature of the callback function invoked on completion of an LSS 'store configuration' request.
Definition: lss_master.hpp:488
lely::canopen::detail::LssIdNonConfigRequestWrapper
Definition: lss_master.hpp:1002
lely::canopen::LssMaster::SubmitIdNonConfig
void SubmitIdNonConfig(detail::LssIdNonConfigRequestBase &req)
Queues an LSS 'identify non-configured remote slave' request.
Definition: lss_master.hpp:2217
ev_task
An executable task.
Definition: task.h:41
lely::io::CanControllerBase
A reference to an abstract CAN controller.
Definition: can.hpp:286
lely::canopen::detail::LssSwitchBitrateRequestBase::delay
int delay
The delay (in milliseconds) before and after the switch, during which CAN frames MUST NOT be sent.
Definition: lss_master.hpp:178
lely::canopen::LssMaster::AbortGetRevision
bool AbortGetRevision(detail::LssGetRevisionRequestBase &req)
Aborts an LSS 'inquire identity revision-number' request.
Definition: lss_master.hpp:2050
lely::canopen::LssMaster::SubmitSetBitrate
void SubmitSetBitrate(int bitrate, F &&con)
Equivalent to SubmitSetBitrate(nullptr, id, con).
Definition: lss_master.hpp:1682
lely::canopen::detail::LssSetIdRequestBase
Definition: lss_master.hpp:148
lely::canopen::LssMaster::SubmitGetVendorId
void SubmitGetVendorId(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'inquire identity vendor-ID' request.
Definition: lss_master.hpp:1895
lely::canopen::LssMaster::AbortStore
bool AbortStore(detail::LssStoreRequestBase &req)
Aborts an LSS 'store configuration' request.
Definition: lss_master.hpp:1846
lely::canopen::make_lss_switch_bitrate_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::LssSwitchBitrateRequestWrapper< F > * >::type make_lss_switch_bitrate_request(ev_exec_t *exec, int delay, F &&con)
Creates an LSS 'activate bit timing parameters' request with a completion task.
Definition: lss_master.hpp:1163
lely::canopen::LssSwitchRequest::Signature
void(::std::error_code ec) Signature
The signature of the callback function invoked on completion of an LSS 'switch state global' request.
Definition: lss_master.hpp:306
lely::canopen::make_lss_id_non_config_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code, bool >::value, detail::LssIdNonConfigRequestWrapper< F > * >::type make_lss_id_non_config_request(ev_exec_t *exec, F &&con)
Creates an LSS 'identify non-configured remote slave' request with a completion task.
Definition: lss_master.hpp:1291
lely::canopen::detail::LssSetBitrateRequestBase::bitrate
int bitrate
The requested pending bit rate (in bit/s) of the LSS slave device.
Definition: lss_master.hpp:164
lely::canopen::LssMaster::SubmitSwitchSelective
void SubmitSwitchSelective(detail::LssSwitchSelectiveRequestBase &req, const LssAddress &address)
Queues an LSS 'switch state selective' request.
Definition: lss_master.hpp:1503
lely::canopen::LssSlowscanRequest
An 'LSS Slowscan' request.
Definition: lss_master.hpp:738
EV_TASK_INIT
#define EV_TASK_INIT(exec, func)
The static initializer for ev_task.
Definition: task.h:53
lely::canopen::LssSetBitrateRequest::Signature
void(::std::error_code ec) Signature
The signature of the callback function invoked on completion of an LSS 'configure bit timing paramete...
Definition: lss_master.hpp:415
lely::canopen::LssGetIdRequest::LssGetIdRequest
LssGetIdRequest(F &&con)
Equivalent to LssGetIdRequest(nullptr, con).
Definition: lss_master.hpp:685
lely::canopen::LssMaster::SubmitSetId
void SubmitSetId(uint8_t id, F &&con)
Equivalent to SubmitSetId(nullptr, id, con).
Definition: lss_master.hpp:1605
lely::canopen::LssStoreRequest
An LSS 'store configuration' request.
Definition: lss_master.hpp:478
lely::canopen::LssGetIdRequest::LssGetIdRequest
LssGetIdRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'store configuration' request with a completion task.
Definition: lss_master.hpp:680
lely::canopen::LssMaster::AbortGetId
bool AbortGetId(detail::LssGetIdRequestBase &req)
Aborts an LSS 'inquire node-ID' request.
Definition: lss_master.hpp:2185
lely::canopen::LssMaster::SubmitSwitchBitrate
void SubmitSwitchBitrate(detail::LssSwitchBitrateRequestBase &req, int delay)
Queues an LSS 'activate bit timing parameters' request.
Definition: lss_master.hpp:1735
lely::canopen::LssMaster::SubmitGetId
void SubmitGetId(F &&con)
Equivalent to SubmitGetId(nullptr, con).
Definition: lss_master.hpp:2173
lely::canopen::LssMaster
The base class for CANopen LSS masters.
Definition: lss_master.hpp:1350
lely::canopen::LssMaster::CancelFastscan
bool CancelFastscan(detail::LssFastscanRequestBase &req)
Cancels an 'LSS Fastscan' request.
Definition: lss_master.hpp:2416
lely::canopen::LssMaster::SubmitSwitchBitrate
void SubmitSwitchBitrate(int delay, F &&con)
Equivalent to SubmitSwitchBitrate(nullptr, id, con).
Definition: lss_master.hpp:1762
lely::canopen::detail::LssSwitchRequestWrapper
Definition: lss_master.hpp:815
lely::canopen::LssSlowscanRequest::LssSlowscanRequest
LssSlowscanRequest(F &&con)
Equivalent to LssSlowscanRequest(nullptr, con).
Definition: lss_master.hpp:762
lely::canopen::LssMaster::SubmitGetRevision
void SubmitGetRevision(F &&con)
Equivalent to SubmitGetRevision(nullptr, con).
Definition: lss_master.hpp:2038
lely::canopen::detail::LssGetNumberRequestBase
Definition: lss_master.hpp:192
lely::canopen::LssMaster::SubmitGetProductCode
void SubmitGetProductCode(F &&con)
Equivalent to SubmitGetProductCode(nullptr, con).
Definition: lss_master.hpp:1970
lely::canopen::detail::LssSetBitrateRequestBase
Definition: lss_master.hpp:159
lely::canopen::LssMaster::SubmitGetRevision
void SubmitGetRevision(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'inquire identity revision-number' request.
Definition: lss_master.hpp:2031
lely::canopen::LssMaster::SubmitSwitch
void SubmitSwitch(LssState state, F &&con)
Equivalent to SubmitSwitch(nullptr, state, con).
Definition: lss_master.hpp:1455
lely::canopen::LssSlowscanRequest::Signature
void(::std::error_code ec, LssAddress address) Signature
The signature of the callback function invoked on completion of an 'LSS Slowscan' request.
Definition: lss_master.hpp:749
lely::canopen::LssMaster::SubmitSlowscan
void SubmitSlowscan(detail::LssSlowscanRequestBase &req, const LssAddress &lo, const LssAddress &hi)
Queues an 'LSS Slowscan' request.
Definition: lss_master.hpp:2291
lely::canopen::detail::LssFastscanRequestWrapper
Definition: lss_master.hpp:1041
lely::canopen::LssMaster::SubmitGetProductCode
void SubmitGetProductCode(detail::LssGetProductCodeRequestBase &req)
Queues an LSS 'inquire identity product-code' request.
Definition: lss_master.hpp:1947
lely::canopen::detail::LssSetIdRequestWrapper
Definition: lss_master.hpp:852
lely::canopen::LssMaster::AbortSwitchBitrate
bool AbortSwitchBitrate(detail::LssSwitchBitrateRequestBase &req)
Aborts an LSS 'activate bit timing parameters' request.
Definition: lss_master.hpp:1774
lely::canopen::detail::LssSwitchSelectiveRequestWrapper
Definition: lss_master.hpp:833
lely::canopen::detail::LssGetSerialNrRequestWrapper
Definition: lss_master.hpp:970
lely::canopen::LssIdNonConfigRequest::LssIdNonConfigRequest
LssIdNonConfigRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'identify non-configured remote slave' request with a completion task.
Definition: lss_master.hpp:717
lely::canopen::LssMaster::SubmitStore
void SubmitStore(detail::LssStoreRequestBase &req)
Queues an LSS 'store configuration' request.
Definition: lss_master.hpp:1811
lely::canopen::LssSetIdRequest
An LSS 'configure node-ID' request.
Definition: lss_master.hpp:369
lely::canopen::LssMaster::SubmitSlowscan
void SubmitSlowscan(ev_exec_t *exec, const LssAddress &lo, const LssAddress &hi, F &&con)
Creates and queues an 'LSS Slowscan' request.
Definition: lss_master.hpp:2313
lely::canopen::LssMaster::AsyncGetSerialNr
LssFuture< uint32_t > AsyncGetSerialNr(detail::LssGetSerialNrRequestBase **preq=nullptr)
Equivalent to AsyncGetSerialNr(nullptr, preq).
Definition: lss_master.hpp:2140
lely::canopen::detail::LssRequestBase
Definition: lss_master.hpp:94
lely::canopen::LssIdNonConfigRequest::Signature
void(::std::error_code ec, bool found) Signature
The signature of the callback function invoked on completion of an LSS 'identify non-configured remot...
Definition: lss_master.hpp:710
ev_task::exec
ev_exec_t * exec
A pointer to the executor to which the task is (to be) submitted.
Definition: task.h:43
lely::canopen::LssMaster::AsyncSlowscan
LssFuture< LssAddress > AsyncSlowscan(const LssAddress &lo, const LssAddress &hi, detail::LssSlowscanRequestBase **preq=nullptr)
Equivalent to AsyncSlowscan(nullptr, lo, hi, preq).
Definition: lss_master.hpp:2358
lely::canopen::LssMaster::SubmitGetProductCode
void SubmitGetProductCode(ev_exec_t *exec, F &&con)
Creates and queues an LSS 'inquire identity product-code' request.
Definition: lss_master.hpp:1963
lely::canopen::LssMaster::AsyncGetVendorId
LssFuture< uint32_t > AsyncGetVendorId(detail::LssGetVendorIdRequestBase **preq=nullptr)
Equivalent to AsyncGetVendorId(nullptr, preq).
Definition: lss_master.hpp:1936
lely::canopen::LssAddress
The 128-bit number uniquely identifying each CANopen node.
Definition: lss_master.hpp:61
lely::canopen::LssMaster::AsyncFastscan
LssFuture< LssAddress > AsyncFastscan(const LssAddress &address={0, 0, 0, 0}, const LssAddress &mask={0, 0, 0, 0}, detail::LssFastscanRequestBase **preq=nullptr)
Equivalent to AsyncFastscan(nullptr, address, mask, preq).
Definition: lss_master.hpp:2451
lely::canopen::LssSetBitrateRequest::LssSetBitrateRequest
LssSetBitrateRequest(ev_exec_t *exec, F &&con)
Constructs an empty LSS 'configure bit timing parameters' request with a completion task.
Definition: lss_master.hpp:423
lely::canopen::make_lss_switch_selective_request
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::LssSwitchSelectiveRequestWrapper< F > * >::type make_lss_switch_selective_request(ev_exec_t *exec, const LssAddress &address, F &&con)
Creates an LSS 'switch state selective' request with a completion task.
Definition: lss_master.hpp:1098