1sergensio_event(3)         Library Functions Manual         sergensio_event(3)
2
3
4

NAME

6       sergensio_event - Event handler for events from a sergensio
7

SYNOPSIS

9       #include <gensio/sergensio.h>
10

DESCRIPTION

12       When  an event happens on a sergensio that is reported to the user, the
13       gensio library calls the gensio_event type handler that was  registered
14       with  the  gensio,  just  like  any  other event on a gensio.  See gen‐
15       sio_event(3) for details on how this happens.
16
17       This document the sergensio-specific events.  These report an  unsigned
18       integer  value  unless  otherwise specified in the description, the buf
19       parameter to the gensio_event handler is a pointer to the unsigned  in‐
20       teger value.
21
22   SERIAL PORT CONTROLS
23       These are controls for serial port settings.  These are received on the
24       server side only.  It should respond by setting the value (if  possible
25       and  the  value  isn't zero) and responding with the current value with
26       sergensio_xxx().
27
28       GENSIO_EVENT_SER_BAUD
29       GENSIO_EVENT_SER_DATASIZE
30       GENSIO_EVENT_SER_PARITY
31       GENSIO_EVENT_SER_STOPBITS
32       GENSIO_EVENT_SER_FLOWCONTROL
33       GENSIO_EVENT_SER_IFLOWCONTROL
34       GENSIO_EVENT_SER_SBREAK
35       GENSIO_EVENT_SER_DTR
36       GENSIO_EVENT_SER_RTS
37
38   SIGNATURE
39       GENSIO_EVENT_SER_SIGNATURE is received on the server side only and is a
40       request  for the signature.  The server should respond by send the sig‐
41       nature with sergensio_signature().  No value is passed in this case.
42
43   STATE FUNCTIONS
44       GENSIO_EVENT_SER_MODEMSTATE_MASK
45       GENSIO_EVENT_SER_LINESTATE_MASK
46       These are received on the server side to request updating the  mask  of
47       reported  values.   The  server should respond by returning the current
48       mask with the sergensio_modemstate  or  sergensio_linestate  functions.
49       The server need not handle all the bits requested by the user.
50
51       GENSIO_EVENT_SER_MODEMSTATE
52       GENSIO_EVENT_SER_LINESTATE
53
54       On  the  client side, these are reporting current modemstate and lines‐
55       tate changes as an unsigned integer.  See  sergensio_modemstate(3)  and
56       sergensio_linestate(3) for a meaning of the bits in the integer.
57
58   OTHER SERIAL PORT CONTROLS
59       These are server-only, these are received requesting the various opera‐
60       tions.  The server should do them, but no response  is  required.   You
61       may  notice  that  break is not here, break is handled through the GEN‐
62       SIO_EVENT_SEND_BREAK event.
63
64       GENSIO_EVENT_SER_FLOW_STATE
65       GENSIO_EVENT_SER_FLUSH
66
67   SYNC
68       GENSIO_EVENT_SER_SYNC is a special operation that comes in when  a  TCP
69       sync  event  is  received.  It may be received on both sides.  A server
70       should send a break.  The client can do whatever it wants with the  in‐
71       formation, that is not defined by the RFC2217 specification.
72

RETURN VALUES

74       Return value are currently ignored for all these events, but you should
75       return 0 on success, GE_NOTSUP if  the  function  isn't  supported,  or
76       other gensio errors as necessary.
77

SEE ALSO

79       sergensio(5), gensio_event(3), gensio_err(3)
80
81
82
83                                 2o July 2020               sergensio_event(3)
Impressum