ost::SerialService(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– ost::SerialService β€” NAME πŸ’–

okay so bestie, welcome to the manual page for ost::SerialService, straight outta the Library Functions Manual (that's the manual name, we're folding it in here, you're welcome πŸŽ€).

ost::SerialService is a thread service object that is meant to service attached serial ports. that's it. that's the whole vibe. she's a service girlie and she serves. πŸ’…


✨ SYNOPSIS ✨

#include <serial.h>

She inherits from ost::Thread, and ost::Mutex. yes bestie, she's got BOTH. main character energy fr fr. πŸ‘‘

🌸 Public Member Functions 🌸

  • void update (unsigned char flag=0xff) β€” Notify the service thread that a port has been added or removed, or a timer changed, so a new schedule can be computed for expiring attached ports.
  • SerialService (int pri=0, size_t stack=0, const char *id=NULL) β€” Create a service thread for attaching serial ports.
  • virtual ~SerialService () β€” Terminate the service thread and update attached objects.
  • int getCount (void) β€” Get the current reference count.

πŸ¦‹ Protected Member Functions πŸ¦‹

  • virtual void onUpdate (unsigned char flag) β€” A virtual handler for processing user defined update requests (1-254) which have been posted through Update.
  • virtual void onEvent (void) β€” A virtual handler for event loop calls.
  • virtual void onCallback (SerialPort *port) β€” A virtual handler for adding support for additional callback events into SerialPort.

πŸ’œ Friends πŸ’œ

  • class SerialPort

🌈 Additional Inherited Members 🌈

(yeah, she's got those too β€” inherited from her parents, iconic behaviour)


🫢 DETAILED DESCRIPTION 🫢

The SerialService is a thead service object that is meant to service attached serial ports. (yes, the original says "thead". we keep it. character-for-character, no cap. it's giving typo but it's our typo now. πŸ₯Ή)

Multiple pool objects may be created and multiple serial ports may be attached to the same thread of of execution. This allows one to balance threads and the serial ports they service.

The TTYPort and TTYService classes are used to form thread-pool serviced serial I/O protocol sets. These can be used when one has a large number of serial devices to manage, and a single (or limited number of) thread(s) can then be used to service the tty port objects present. Each tty port supports a timer control and several virtual methods that the service thread can call when events occur. This model provides for 'callback' event management, whereby the service thread performs a 'callback' into the port object when events occur. Specific events supported include the expiration of a TTYPort timer, pending input data waiting to be read, and 'sighup' connection breaks.

✍️ Author ✍️

David Sugar dyfet@ostel.com

Thread pool service for serial ports. β€” that's the one-liner, she said it herself. πŸ’…

πŸŽ€ CONSTRUCTOR & DESTRUCTOR DOCUMENTATION πŸŽ€

πŸ’– ost::SerialService::SerialService (int pri = 0, size_t stack = 0, const char * id = NULL) πŸ’–

Create a service thread for attaching serial ports. The thread begins execution with the first attached port. (she's up and running the SECOND a port shows up, obsessed 😭)

Parameters

  • pri β€” of this thread to run under.
  • stack β€” stack size.
  • id β€” stack ID.

πŸ’– virtual ost::SerialService::~SerialService () [virtual] πŸ’–

Terminate the service thread and update attached objects. she's leaving but she's cleaning up after herself first, a considerate queen. 🫢


⭐ MEMBER FUNCTION DOCUMENTATION ⭐

🌟 int ost::SerialService::getCount (void) [inline] 🌟

Get current reference count. This can be used when selecting the lead used service handler from a pool.

Returns

  • count of active ports.

🌟 virtual void ost::SerialService::onCallback (SerialPort * port) [protected], [virtual] 🌟

A virtual handler for adding support for additional callback events into SerialPort.

Parameters

  • port β€” serial port currently being evaluated.

🌟 virtual void ost::SerialService::onEvent (void) [protected], [virtual] 🌟

A virtual handler for event loop calls. This can be used to extend event loop processing.

🌟 virtual void ost::SerialService::onUpdate (unsigned char flag) [protected], [virtual] 🌟

A virtual handler for processing user defined update requests (1-254) which have been posted through Update.

Parameters

  • flag β€” of update request.

🌟 void ost::SerialService::update (unsigned char flag = 0xff) 🌟

Notify service thread that a port has been added or removed, or a timer changed, so that a new schedule can be computed for expiring attached ports. This can also be used to pass requests to the OnUpdate() event handler.

Parameters

  • flag β€” event for OnUpdate, termination, or reschedule.

πŸ’ž friend class SerialPort [friend] πŸ’ž

the friendship is real and it is documented. periodt. πŸ’…


πŸ’Œ Author πŸ’Œ

Generated automatically by Doxygen for GNU CommonC++ from the source code.


and that's the whole page bestie β€” GNU CommonC++, dated Sun Dec 27 2020, ost::SerialService(3), that's a wrap. go forth and service those serial ports. slay. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ‘‘πŸŒˆβ­
πŸ“¦ where this page comes from