A Print implementation that buffers and sends data over UDP.
More...
#include <UDPPrint.h>
|
| | 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)
|
| |
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:
up.
begin(
"192.168.1.100", 5000);
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
◆ UDPPrint()
◆ ~UDPPrint()
◆ 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()
◆ 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: