56 ACTRACE(
"write %d bytes. Dump:",len )
57 AC_TRACE(Serial.write(data, len));
58 AC_TRACE(Serial.println());
72 return write(s.length(), (uint8_t*)s.c_str());
109 va_start(args, pattern);
110 PGM_P p = (PGM_P)pattern;
115 c = (char)pgm_read_byte(p++);
119 c = (char)pgm_read_byte(p);
122 bytes +=
write(i, (uint8_t*)buf);
123 bytes +=
write(*va_arg(args, String*));
132 bytes +=
write(i, (uint8_t*)buf);
139 if (i ==
sizeof(buf))
141 bytes +=
write(i, (uint8_t*)buf);
162 pseudo.
h.
l = protocol;
197 return ~
Checksum::add(headerChecksum, dataChecksum);
207 #if ENABLE_UDPTCP_RX_CHECKSUM
208 uint8_t headerLength;
226 uint16_t dataChecksum;
229 uint16_t dataLength = totalLength - headerLength;
nint16_t h
most significant integer
uint16_t write(uint16_t len, const byte *data)
In the case of TCP, writes the given data buffer to the socket.
static EthBuffer packet
in-memory packet buffer currently being processed.
nint16_t l
least significant integer
static bool verifyUDPTCPChecksum()
Verifies if the UDP or TCP checksum of the current packet is correct.
static uint16_t calc(uint16_t len, const uint8_t *data)
Calculates the checksum of the specified buffer in memory
represents an IP address in memory
SharedBuffer buffer
output buffer for this socket
Represents a network byte order 32 bit integer.
static uint16_t add(uint16_t a, uint16_t b)
Adds two checksums, taking carry into account.
static uint16_t calcUDPChecksum(uint16_t dataLength, uint16_t dataChecksum)
Calculates the UDP checksum.
Contains functions to perform IP checksum operations.
uint16_t write(uint16_t len, const byte *data)
Writes a fragment to the shared buffer
static uint16_t calcTCPChecksum(bool options, uint16_t dataLength, uint16_t dataChecksum)
Calculates the TCP checksum.
Structure to encode one 2-byte long TCP option.
static const uint8_t IP_PROTO_TCP
IP header protocol type for TCP.
static void prepareIPPacket(const IPAddress &remoteIP)
Sets up common IP header values for all outgoing IP packets and calculates the IP header checksum ...
static uint8_t srcPort_L_count
self-incrementing counter for local ports.
uint8_t l
least significant byte
static uint16_t calcPseudoHeaderChecksum(uint8_t protocol, uint16_t length)
Calculates the TCP or UDP pseudo header checksum.
IPAddress remoteIP
remote IP address to connect to (TCP) or send the next packet to (UDP)
uint8_t h
most significant byte
static const uint8_t IP_PROTO_UDP
IP header protocol type for UDP.