26#pragma clang diagnostic ignored "-Wc++98-compat"
57 const void* cb_object)
noexcept
59 cb_port_func_ = cb_func;
60 cb_port_object_ = cb_object;
65 const void* cb_object)
noexcept
67 cb_pipe_func_ = cb_func;
68 cb_pipe_object_ = cb_object;
75 std::size_t num)
noexcept
77 assert (data !=
nullptr);
82 return do_transfer (pipe, packet, data, num);
90 if (cb_port_func_ !=
nullptr)
93 cb_port_func_ (cb_port_object_, port, event);
100 if (cb_pipe_func_ !=
nullptr)
103 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