sergensio_event(3)

πŸ“¦
version 2.8.15 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, debian trixie, epel 9, fedora 43, opensuse-leap 16.0, ubuntu noble, ubuntu questing

πŸ’– sergensio_event β€” the tea on sergensio events πŸ’–

okay bestie, welcome to sergensio_event(3), from the Library Functions Manual, and no cap this is the page that tells you how events coming off a sergensio get delivered to you. let's get into it ✨


🌸 NAME 🌸

sergensio_event β€” the event handler for events coming from a sergensio. it's giving "your sergensio has something to say and this is how it says it." πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <gensio/sergensio.h>

that's it. that's the whole include. iconic. 🫢


✨ DESCRIPTION ✨

so when an event happens on a sergensio and it gets reported to the user, the gensio library calls the gensio_event type handler that was registered with the gensio. literally just like any other event on a gensio. if you want the full rundown on how that whole delivery thing works, go read gensio_event(3), it's right there. πŸ“š

this page is all about the sergensio-specific events, the ones that are special to sergensio. and here's the vibe: these report an unsigned integer value, unless the description says otherwise. the buf parameter that gets passed to the gensio_event handler? yeah, that's a pointer to that unsigned integer value. 🎯


πŸ”Œ SERIAL PORT CONTROLS πŸ”Œ

these are the controls for serial port settings. important: these are received on the server side only. when you get one, you should respond by setting the value β€” if it's possible and the value isn't zero β€” and then respond with the current value using sergensio_xxx(). simple as that. πŸ’«

  • GENSIO_EVENT_SER_BAUD
  • GENSIO_EVENT_SER_DATASIZE
  • GENSIO_EVENT_SER_PARITY
  • GENSIO_EVENT_SER_STOPBITS
  • GENSIO_EVENT_SER_FLOWCONTROL
  • GENSIO_EVENT_SER_IFLOWCONTROL
  • GENSIO_EVENT_SER_SBREAK
  • GENSIO_EVENT_SER_DTR
  • GENSIO_EVENT_SER_RTS

✍️ SIGNATURE ✍️

GENSIO_EVENT_SER_SIGNATURE is received on the server side only and it's basically someone asking "hey, what's your signature?" πŸ–ŠοΈ

the server should respond by sending the signature with sergensio_signature(). and heads up β€” no value is passed in this case. none. zero. nada. πŸ™ˆ


πŸ“Š STATE FUNCTIONS πŸ“Š

  • GENSIO_EVENT_SER_MODEMSTATE_MASK
  • GENSIO_EVENT_SER_LINESTATE_MASK

these two show up on the server side to request updating the mask of reported values. the server should respond by returning the current mask, using the sergensio_modemstate or sergensio_linestate functions. πŸŽ›οΈ

lowkey important: the server does not have to handle all the bits that the user requested. so don't come for the server if it only gives you some of them. πŸ’€
  • GENSIO_EVENT_SER_MODEMSTATE
  • GENSIO_EVENT_SER_LINESTATE

on the client side, these two are reporting current modemstate and linestate changes as an unsigned integer. want to know what all those bits actually mean? go check sergensio_modemstate(3) and sergensio_linestate(3), they'll explain the bits for you. 🧠


πŸ› οΈ OTHER SERIAL PORT CONTROLS πŸ› οΈ

these are server-only, and they come in requesting the various operations. the server should just do them β€” no response is required, it's a "do it and move on" situation, main character energy fr. 🫑

also, you might notice that break is not here. that's not a typo bestie, break is handled through the GENSIO_EVENT_SEND_BREAK event instead. ✨

  • GENSIO_EVENT_SER_FLOW_STATE
  • GENSIO_EVENT_SER_FLUSH

πŸ”„ SYNC πŸ”„

GENSIO_EVENT_SER_SYNC is a special operation that comes in when a TCP sync event is received. it may be received on both sides. πŸ‘€

a server should send a break. the client can do whatever it wants with the information β€” that part is literally not defined by the RFC2217 specification, so go off, client. 🌈


πŸ’œ RETURN VALUES πŸ’œ

ngl, the return values are currently ignored for all of these events. but still β€” do the right thing, bestie. return:

  • 0 on success πŸŽ‰
  • GE_NOTSUP if the function isn't supported πŸ™…
  • other gensio errors as necessary 🧾

πŸ‘€ SEE ALSO πŸ‘€

sergensio(5), gensio_event(3), gensio_err(3)


and that's a wrap on the sergensio event saga, bestie. this page came from the Library Functions Manual and was last touched up on 2o July 2020. go forth and handle your events, you absolute legend. πŸ’…πŸ’–πŸ¦‹

πŸ“¦ where this page comes from