UPSCLI_SENDLINE(3)

πŸ“¦
version 2.8.5 Β· 4 versions
, in arch rolling

πŸ’Œ UPSCLI_SENDLINE(3) β€” NUT Manual, bestie πŸ’Œ

okay so this is the NUT Manual page for UPSCLI_SENDLINE(3), and it's literally about sending one single command to a UPS. group-chat mode activated, facts fully intact, no cap. πŸ’–

πŸ’– NAME πŸ’–

upscli_sendline, upscli_sendline_timeout, upscli_sendline_timeout_may_disconnect β€” send a single command to a UPS. that's the whole vibe. ✨

πŸŽ€ SYNOPSIS πŸŽ€

               #include <upsclient.h>
               #include <time.h> /* or <sys/time.h> on some platforms */

               int upscli_sendline(UPSCONN_t *ups, const char *buf, size_t buflen);

               int upscli_sendline_timeout(UPSCONN_t *ups, const char *buf, size_t buflen,
                       const time_t timeout);

               int upscli_sendline_timeout_may_disconnect(UPSCONN_t *ups,
                       const char *buf, size_t buflen, const time_t timeout,
                       int may_disconnect);

🌸 DESCRIPTION 🌸

The upscli_sendline() and upscli_sendline_timeout() functions take the pointer ups to a UPSCONN_t state structure and transmit a buffer buf of size buflen to the server. 🫢

The data in buf must be a fully formatted protocol command as no parsing of the buffer occurs within this function. like, it is not doing the formatting for you, bestie β€” you bring the fully formatted command. πŸ’…

The difference between the three functions is that upscli_sendline_timeout() lets the caller decide the amount of time (timeout seconds) after which it should give up and return, whereas upscli_sendline() does not offer this freedom, and uses an immediate timeout (0 second). Both of these disconnect upon errors. The upscli_sendline_timeout_may_disconnect() further allows to enable or disable such disconnections. πŸ”₯

🌈 RETURN VALUE 🌈

The upscli_sendline() and upscli_sendline_timeout() functions return 0 on success, or -1 if an error occurs. πŸ‘‘

πŸ¦‹ SEE ALSO πŸ¦‹

go peek at these too, iykyk. 🧚


That's the whole page, bestie β€” from Network UPS Tools 2.8.5, dated 06/21/2026. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from
  • arch rolling: nut 2.8.5-2 Β· GPL-2.0-or-later AND GPL-3.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms