26#if !LELY_NO_COAPP_MASTER
34BasicLogicalDriver<BasicDriver>::BasicLogicalDriver(BasicDriver& driver_,
35 int num, uint32_t dev)
36 : master(driver_.master),
40 tpdo_event_mutex(driver_.tpdo_event_mutex),
46BasicLogicalDriver<BasicDriver>::~BasicLogicalDriver() { driver.Erase(*
this); }
54 auto read_67ff = [
this]() {
55 return AsyncRead<uint32_t>(0x67ff, 0).then(
63 auto check_1000 = [
this, read_67ff](uint32_t value) ->
SdoFuture<void> {
64 if ((value) >> 16 == 0xffff)
return read_67ff();
71 auto value = driver.master[0x1f84][driver.id()].Read<uint32_t>(ec);
73 f = check_1000(value);
77 f = AsyncRead<uint32_t>(0x1000, 0).then(
79 return check_1000(f.get().value());
94 OnConfig([p](::std::error_code ec)
mutable {
95 p.
set(::std::make_exception_ptr(::std::system_error(ec,
"OnConfig")));
105 GetExecutor().post([
this, p]()
mutable {
106 OnDeconfig([p](::std::error_code ec)
mutable {
107 p.
set(::std::make_exception_ptr(::std::system_error(ec,
"OnDeconfig")));
The base class for drivers for logical devices on remote CANopen nodes.
Future< T, E > get_future() const noexcept
Returns a lely::ev::Future with (a reference to) the same shared state as *this.
bool set(U &&u)
Satisfies a promise, if it was not aready satisfied, and stores the specified value as the result in ...
This is the internal header file of the C++ CANopen application library.
This header file is part of the C++ CANopen application library; it contains the logical device drive...
SdoFuture< void > make_empty_sdo_future()
Returns an SDO future with a shared state that is immediately ready, containing a successful result o...