gensio_open_channel(3)

NAME
gensio_open_channel, gensio_open_channel_s - Open a channel on a channel-capable gensio

SYNOPSIS
#include <gensio/gensio.h>

typedef void (*gensio_done_err)(struct gensio *io, int err,
    void *open_data);

int gensio_open_channel(struct gensio *io, const char * const args[],
    gensio_event cb, void *user_data,
    gensio_done_err open_done, void *open_data,
    struct gensio **new_io);

int gensio_open_channel_s(struct gensio *io, const char * const args[],
    gensio_event cb, void *user_data,
    struct gensio **new_io);

DESCRIPTION
gensio_open_channel creates a new channel on a channel-capable gensio. The exact meaning of channel, and the meaning of args depends on the particular gensio, see the the particular gensio class in gensio(5). If no error is returned, the open_done callback will be called, if there is no error in the callback err value the gensio channel will be open. The cb is set for that channel, see gensio_event(3) for details on that. gensio_open_channel_s is like gensio_open_channel, but waits for the open to complete. Normal gensio processing will happen while waiting. Note that you must be careful to not call this from a callback, you should only call this from a non-callback thread or a runner (see gensio_os_funcs(3) for details on runners).

RETURN VALUES
Zero is returned on success, or a gensio error on failure.

SEE ALSO
gensio_err(3), gensio(5), gensio_os_funcs(3), gensio_event(3)