27#if !LELY_NO_COAPP_MASTER
39FiberDriverBase::FiberDriverBase(
ev_exec_t* exec_)
40#if !_WIN32 && _POSIX_MAPPED_FILES
41 : thrd(ev::FiberFlag::SAVE_ERROR | ev::FiberFlag::GUARD_STACK),
43 : thrd(ev::FiberFlag::SAVE_ERROR),
52 : FiberDriverBase(exec ? exec
61 }
catch (const ::std::system_error& e) {
64 ec = ::std::make_error_code(::std::errc::operation_canceled);
72 if (ec) throw ::std::system_error(ec,
"USleep");
78 auto f =
master.AsyncWait(::std::chrono::microseconds(usec), &wait);
81 if (!f.is_ready())
master.CancelWait(*wait);
An asynchronous CANopen master.
ev::Executor GetExecutor() const noexcept final
Returns the executor used to execute event handlers for this driver, including SDO confirmation funct...
uint8_t id() const noexcept final
Returns the node-ID.
BasicDriver(ev_exec_t *exec, BasicMaster &master, uint8_t id)
Creates a new driver for a remote CANopen node and registers it with the master.
BasicMaster & master
A reference to the master with which this driver is registered.
T Wait(SdoFuture< T > f)
Waits for the specified future to become ready by suspending the calling fiber.
FiberDriver(ev_exec_t *exec, AsyncMaster &master, uint8_t id)
Creates a new CANopen driver and its associated fiber executor.
void USleep(uint_least64_t usec)
Suspends the calling fiber for usec microseconds.
result_type & get()
Returns the result of a ready future.
The exception thrown when retrieving the result of a future which is not ready or does not contain a ...
value_type & value()
Returns a reference to the value if *this contains a value, and throws an exception if *this contains...
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 declarations for the...
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
The namespace for implementation details of the C++ CANopen application library.
The namespace for the C++ CANopen application library.
ev::Future< T, ::std::exception_ptr > SdoFuture
A helper alias template for the type of future used to retrieve the result of an asynchronous SDO req...
A wait operation suitable for use with a timer queue.