41#pragma clang diagnostic ignored "-Wc++98-compat"
72 const void* cb_object)
noexcept
74 cb_port_func_ = cb_func;
75 cb_port_object_ = cb_object;
80 const void* cb_object)
noexcept
82 cb_pipe_func_ = cb_func;
83 cb_pipe_object_ = cb_object;
90 std::size_t num)
noexcept
92 assert (data !=
nullptr);
97 return do_transfer (pipe, packet, data, num);
105 if (cb_port_func_ !=
nullptr)
108 cb_port_func_ (cb_port_object_, port, event);
115 if (cb_pipe_func_ !=
nullptr)
118 cb_pipe_func_ (cb_pipe_object_, pipe, event);
host::signal_port_event_t cb_port_func_
Pointer to static function that implements the port callback.
void register_port_callback(host::signal_port_event_t cb_func, const void *cb_object=nullptr) noexcept
Register port event callback.
void signal_pipe_event(pipe_t pipe, event_t event) noexcept
host::signal_pipe_event_t cb_pipe_func_
Pointer to static function that implements the pipe callback.
return_t transfer(pipe_t pipe, uint32_t packet, uint8_t *data, std::size_t num) noexcept
const void * cb_pipe_object_
Pointer to object instance associated with the pipe callback.
const void * cb_port_object_
Pointer to object instance associated with the port callback.
virtual ~Host() noexcept override
void register_pipe_callback(host::signal_pipe_event_t cb_func, const void *cb_object=nullptr) noexcept
void signal_port_event(port_t port, event_t event) noexcept
int printf(const char *format,...)
Write a formatted string to the trace device.
void(* signal_pipe_event_t)(const void *object, pipe_t pipe, event_t event)
void(* signal_port_event_t)(const void *object, port_t port, event_t event)
constexpr return_t RETURN_OK
< Operation succeeded