H.264 Codec for ESP32-S3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
UDPPrint Class Reference

A Print implementation that buffers and sends data over UDP. More...

#include <UDPPrint.h>

Inheritance diagram for UDPPrint:
Inheritance graph
[legend]
Collaboration diagram for UDPPrint:
Collaboration graph
[legend]

Public Member Functions

 UDPPrint ()
 
 ~UDPPrint ()
 
bool initWiFi (const char *ssid, const char *password)
 
bool begin (const char *destIp, uint16_t destPort)
 
bool begin (const IPAddress &addr, uint16_t destPort)
 
size_t write (uint8_t ch) override
 
size_t write (const uint8_t *data, size_t size) override
 
void flush ()
 
size_t print (const char *s)
 
size_t println (const char *s)
 
void setWriteDelay (unsigned long ms)
 Set delay after sending a UDP packet (default 100ms)
 

Detailed Description

A Print implementation that buffers and sends data over UDP.

UDPPrint extends Arduino's Print class to send data over UDP networks. It internally buffers data and sends UDP packets when the buffer fills or when explicitly flushed.

Note
WiFi connection must be established before using this class
Data is buffered up to BUF_SIZE (1400 bytes) before automatic transmission

Example usage:

#include "UDPPrint.h"
up.begin("192.168.1.100", 5000);
up.print("Hello World");
up.flush(); // Send immediately
header-only Arduino Print implementation that sends data over
A Print implementation that buffers and sends data over UDP.
Definition: UDPPrint.h:35
size_t print(const char *s)
Definition: UDPPrint.h:131
bool begin(const char *destIp, uint16_t destPort)
Definition: UDPPrint.h:59
void flush()
Definition: UDPPrint.h:102

Constructor & Destructor Documentation

◆ UDPPrint()

UDPPrint ( )
inline

◆ ~UDPPrint()

~UDPPrint ( )
inline

Member Function Documentation

◆ begin() [1/2]

bool begin ( const char *  destIp,
uint16_t  destPort 
)
inline

◆ begin() [2/2]

bool begin ( const IPAddress &  addr,
uint16_t  destPort 
)
inline

◆ flush()

void flush ( )
inline

◆ initWiFi()

bool initWiFi ( const char *  ssid,
const char *  password 
)
inline

◆ print()

size_t print ( const char *  s)
inline

◆ println()

size_t println ( const char *  s)
inline

◆ setWriteDelay()

void setWriteDelay ( unsigned long  ms)
inline

Set delay after sending a UDP packet (default 100ms)

◆ write() [1/2]

size_t write ( const uint8_t *  data,
size_t  size 
)
inlineoverride

◆ write() [2/2]

size_t write ( uint8_t  ch)
inlineoverride

The documentation for this class was generated from the following file: