MODBUS_FLUSH(3)
π MODBUS_FLUSH(3) π
okay bestie, pull up a chair, we're reading a libmodbus Manual page together and honestly? it's a short one, which is so rare in this house. π this is the tea on modbus_flush, and yes it's giving tiny-but-mighty.
β¨ NAME β¨
modbus_flush β flush non-transmitted data π½β¨
πΈ SYNOPSIS πΈ
int modbus_flush(modbus_t *ctx);
like. that's it. one line. iconic behavior honestly. π
π¦ DESCRIPTION π¦
so the modbus_flush() function shall discard data received but not read to the socket or the file descriptor that's associated with the context ctx. π§
that's the whole vibe: stuff came in, nobody read it, and now it's gone. bye bestie. π
π₯ RETURN VALUE π₯
so here's what you're getting back:
- on success it shall return
0β or the number of flushed bytes π«Ά - otherwise it shall return
-1and seterrnoπ
not me checking errno every single time. but like. do it. fr fr. π
π AUTHORS π
the libmodbus documentation was written by StΓ©phane Raimbault <stephane.raimbault@gmail.com> π
and that's the whole page, no cap. π this little cutie came from libmodbus v3.1.6, dated 11/17/2025 β mwah, love that for us, periodt. π
π¦ where this page comes from
- debian bookworm: libmodbus-dev 3.1.6-2.1+deb12u1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms