W60X_Arduino: UDP Class Reference

Arduino W60X

W60X_Arduino
UDP Class Referenceabstract

Inherits Stream.

Inherited by WiFiUDP.

Public Member Functions

virtual uint8_t begin (uint16_t)=0
 This function is used to initializes the UDP library and network settings, Starts UDP socket, listening at local port. More...
 
virtual void stop ()=0
 This function is used to disconnect from the server. Release any resource being used during the UDP session. More...
 
virtual int beginPacket (IPAddress ip, uint16_t port)=0
 This function is used to starts a connection to write UDP data to the remote connection. More...
 
virtual int beginPacket (const char *host, uint16_t port)=0
 This function is used to starts a connection to write UDP data to the remote connection. More...
 
virtual int endPacket ()=0
 This function is used to called after writing UDP data to the remote connection. It finishes off the packet and send it. More...
 
virtual size_t write (uint8_t)=0
 This function is used to writes UDP data to the remote connection. More...
 
virtual size_t write (const uint8_t *buffer, size_t size)=0
 This function is used to writes UDP data to the remote connection. More...
 
virtual int parsePacket ()=0
 It starts processing the next available incoming packet, checks for the presence of a UDP packet, and reports the size. More...
 
virtual int available ()=0
 Get the number of bytes (characters) available for reading from the buffer. This is is data that's already arrived. More...
 
virtual int read ()=0
 Reads UDP data from the specified buffer. If no arguments are given, it will return the next character in the buffer. More...
 
virtual int read (unsigned char *buffer, size_t len)=0
 Reads UDP data from the specified buffer. If no arguments are given, it will return the next character in the buffer. More...
 
virtual int read (char *buffer, size_t len)=0
 Reads UDP data from the specified buffer. If no arguments are given, it will return the next character in the buffer. More...
 
virtual int peek ()=0
 Read a byte from the file without advancing to the next one.
That is, successive calls to peek() will return the same value, as will the next call to read(). More...
 
virtual void flush ()=0
 Discard any bytes that have been written to the client but not yet read. More...
 
virtual IPAddress remoteIP ()=0
 This function is used to gets the IP address of the remote connection. More...
 
virtual uint16_t remotePort ()=0
 This function is used to gets the port of the remote UDP connection. More...
 
- Public Member Functions inherited from Stream
void setTimeout (unsigned long timeout)
 setTimeout() sets the maximum milliseconds to wait for stream data, it defaults to 1000 milliseconds. This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the Stream class main page for more information. More...
 
bool find (const char *target)
 find() reads data from the stream until the target string of given length is found The function returns true if target string is found, false if timed out. More...
 
bool find (uint8_t *target)
 find() reads data from the stream until the target string of given length is found The function returns true if target string is found, false if timed out. More...
 
bool find (const char *target, size_t length)
 find() reads data from the stream until the target string of given length is found The function returns true if target string is found, false if timed out. More...
 
bool find (const uint8_t *target, size_t length)
 find() reads data from the stream until the target string of given length is found The function returns true if target string is found, false if timed out. More...
 
bool find (char target)
 find() reads data from the stream until the target string of given length is found The function returns true if target string is found, false if timed out. More...
 
bool findUntil (const char *target, const char *terminator)
 findUntil() reads data from the stream until the target string of given length or terminator string is found. More...
 
bool findUntil (const uint8_t *target, const char *terminator)
 findUntil() reads data from the stream until the target string of given length or terminator string is found. More...
 
bool findUntil (const char *target, size_t targetLen, const char *terminate, size_t termLen)
 findUntil() reads data from the stream until the target string of given length or terminator string is found. More...
 
bool findUntil (const uint8_t *target, size_t targetLen, const char *terminate, size_t termLen)
 findUntil() reads data from the stream until the target string of given length or terminator string is found. More...
 
long parseInt ()
 parseInt() returns the first valid (long) integer number from the serial buffer. Characters that are not integers (or the minus sign) are skipped. More...
 
float parseFloat ()
 parseFloat() returns the first valid floating point number from the current position. Initial characters that are not digits (or the minus sign) are skipped. parseFloat() is terminated by the first character that is not a floating point number. More...
 
virtual size_t readBytes (char *buffer, size_t length)
 readBytes() read characters from a stream into a buffer. The function terminates if the determined length has been read, or it times out (see setTimeout()). More...
 
virtual size_t readBytes (uint8_t *buffer, size_t length)
 readBytes() read characters from a stream into a buffer. The function terminates if the determined length has been read, or it times out (see setTimeout()). More...
 
size_t readBytesUntil (char terminator, char *buffer, size_t length)
 readBytesUntil() reads characters from a stream into a buffer. The function terminates if the terminator character is detected, the determined length has been read, or it times out (see setTimeout()). More...
 
size_t readBytesUntil (char terminator, uint8_t *buffer, size_t length)
 readBytesUntil() reads characters from a stream into a buffer. The function terminates if the terminator character is detected, the determined length has been read, or it times out (see setTimeout()). More...
 
String readString ()
 readString() reads characters from a stream into a string. The function terminates if it times out (see setTimeout()). More...
 
String readStringUntil (char terminator)
 readStringUntil() reads characters from a stream into a string. The function terminates if the terminator character is detected or it times out (see setTimeout()). More...
 
- Public Member Functions inherited from Print
int getWriteError ()
 This function is used to get write error number. More...
 
void clearWriteError ()
 This function is used to clear write error number. More...
 
size_t write (const char *str)
 This function is used to write buffer to the interface defined by the object. More...
 
size_t write (const char *buffer, size_t size)
 This function is used to write buffer to the interface defined by the object. More...
 
size_t print (const String &)
 This function is used to print buffer to the interface defined by the object. More...
 
size_t print (const char [])
 This function is used to print buffer to the interface defined by the object. More...
 
size_t print (char)
 This function is used to print buffer to the interface defined by the object. More...
 
size_t print (unsigned char, int=DEC)
 This function is used to print target to the interface defined by the object. More...
 
size_t print (int, int=DEC)
 This function is used to print target to the interface defined by the object. More...
 
size_t print (unsigned int, int=DEC)
 This function is used to print target to the interface defined by the object. More...
 
size_t print (long, int=DEC)
 This function is used to print target to the interface defined by the object. More...
 
size_t print (unsigned long, int=DEC)
 This function is used to print target to the interface defined by the object. More...
 
size_t print (double, int=BIN)
 This function is used to print target to the interface defined by the object. More...
 
size_t print (const Printable &)
 This function is used to print target to the interface defined by the object. More...
 
size_t println (void)
 This function is used to print target to the interface defined by the object with carriage ret ('') and new line ('
'). More...
 
size_t println (const String &s)
 This function is used to print target to the interface defined by the object with carriage ret ('') and new line ('
'). More...
 
size_t println (const char [])
 This function is used to print target to the interface defined by the object with carriage ret ('') and new line ('
'). More...
 
size_t println (char)
 This function is used to print target to the interface defined by the object with carriage ret ('') and new line ('
'). More...
 
size_t println (unsigned char, int=DEC)
 This function is used to print target to the interface defined by the object with carriage ret ('') and new line ('
'). More...
 
size_t println (int, int=DEC)
 This function is used to print target to the interface defined by the object with carriage ret ('') and new line ('
'). More...
 
size_t println (unsigned int, int=DEC)
 This function is used to print target to the interface defined by the object with carriage ret ('') and new line ('
'). More...
 
size_t println (long, int=DEC)
 This function is used to print target to the interface defined by the object with carriage ret ('') and new line ('
'). More...
 
size_t println (unsigned long, int=DEC)
 This function is used to print target to the interface defined by the object with carriage ret ('') and new line ('
'). More...
 
size_t println (double, int=BIN)
 This function is used to print target to the interface defined by the object with carriage ret ('') and new line ('
'). More...
 
size_t println (const Printable &)
 This function is used to print target to the interface defined by the object with carriage ret ('') and new line ('
'). More...
 

Additional Inherited Members

- Protected Member Functions inherited from Stream
int timedRead ()
 
int timedPeek ()
 
int peekNextDigit ()
 
long parseInt (char skipChar)
 
float parseFloat (char skipChar)
 
- Protected Member Functions inherited from Print
void setWriteError (int err=1)
 
- Protected Attributes inherited from Stream
unsigned long _timeout
 
unsigned long _startMillis
 

Member Function Documentation

◆ available()

virtual int UDP::available ( )
pure virtual

Get the number of bytes (characters) available for reading from the buffer. This is is data that's already arrived.

Parameters
[in]None
[out]None
Return values
0parsePacket hasn't been called yet
otherthe number of bytes available in the current packet
Note
This function can only be successfully called after UDP.parsePacket(). available() inherits from the Stream utility class.

Implements Stream.

Implemented in WiFiUDP.

◆ begin()

virtual uint8_t UDP::begin ( uint16_t  )
pure virtual

This function is used to initializes the UDP library and network settings, Starts UDP socket, listening at local port.

Parameters
[in]thelocal port to listen on
[out]None
Return values
1successful
0there are no sockets available to use
Note

Implemented in WiFiUDP.

◆ beginPacket() [1/2]

virtual int UDP::beginPacket ( IPAddress  ip,
uint16_t  port 
)
pure virtual

This function is used to starts a connection to write UDP data to the remote connection.

Parameters
[in]ipthe IP address of the remote connection (4 bytes)
[in]portthe port of the remote connection (int)
[out]None
Return values
1successful
0there was a problem with the supplied IP address or port
Note

Implemented in WiFiUDP.

◆ beginPacket() [2/2]

virtual int UDP::beginPacket ( const char *  host,
uint16_t  port 
)
pure virtual

This function is used to starts a connection to write UDP data to the remote connection.

Parameters
[in]hostthe address of the remote host. It accepts a character string or an IPAddress
[in]portthe port of the remote connection (int)
[out]None
Return values
1successful
0there was a problem with the supplied IP address or port
Note

Implemented in WiFiUDP.

◆ endPacket()

virtual int UDP::endPacket ( )
pure virtual

This function is used to called after writing UDP data to the remote connection. It finishes off the packet and send it.

Parameters
[in]None
[out]None
Return values
1the packet was sent successfully
0there was an error
Note

Implemented in WiFiUDP.

◆ flush()

virtual void UDP::flush ( )
pure virtual

Discard any bytes that have been written to the client but not yet read.

Parameters
[in]None
[out]None
Returns
None
Note
flush() inherits from the Stream utility class.

Implemented in WiFiUDP.

◆ parsePacket()

virtual int UDP::parsePacket ( )
pure virtual

It starts processing the next available incoming packet, checks for the presence of a UDP packet, and reports the size.

Parameters
[in]None
[out]None
Return values
0no packets are available
otherthe size of the packet in bytes
Note
parsePacket() must be called before reading the buffer with UDP.read().

Implemented in WiFiUDP.

◆ peek()

virtual int UDP::peek ( )
pure virtual

Read a byte from the file without advancing to the next one.
That is, successive calls to peek() will return the same value, as will the next call to read().

Parameters
[in]None
[out]None
Return values
-1none is available
otherthe next byte or character
Note
This function inherited from the Stream class. See the Stream class main page for more information.

Implements Stream.

Implemented in WiFiUDP.

◆ read() [1/3]

virtual int UDP::read ( )
pure virtual

Reads UDP data from the specified buffer. If no arguments are given, it will return the next character in the buffer.

Parameters
[in]None
[out]None
Return values
-1no buffer is available
otherthe characters in the buffer (char)
Note

Implements Stream.

Implemented in WiFiUDP.

◆ read() [2/3]

virtual int UDP::read ( unsigned char *  buffer,
size_t  len 
)
pure virtual

Reads UDP data from the specified buffer. If no arguments are given, it will return the next character in the buffer.

Parameters
[in]bufferbuffer to hold incoming packets (unsigned char*)
[in]lenmaximum size of the buffer (int)
[out]None
Return values
-1no buffer is available
otherthe size of the buffer
Note

Implemented in WiFiUDP.

◆ read() [3/3]

virtual int UDP::read ( char *  buffer,
size_t  len 
)
pure virtual

Reads UDP data from the specified buffer. If no arguments are given, it will return the next character in the buffer.

Parameters
[in]bufferbuffer to hold incoming packets (char*)
[in]lenmaximum size of the buffer (int)
[out]None
Return values
-1no buffer is available
otherthe size of the buffer
Note

Implemented in WiFiUDP.

◆ remoteIP()

virtual IPAddress UDP::remoteIP ( )
pure virtual

This function is used to gets the IP address of the remote connection.

Parameters
[in]None
[out]None
Return values
theIP address of the host who sent the current incoming packet(4 bytes)
Note
This function must be called after UDP.parsePacket().

Implemented in WiFiUDP.

◆ remotePort()

virtual uint16_t UDP::remotePort ( )
pure virtual

This function is used to gets the port of the remote UDP connection.

Parameters
[in]None
[out]None
Return values
Theport of the host who sent the current incoming packet
Note
This function must be called after UDP.parsePacket().

Implemented in WiFiUDP.

◆ stop()

virtual void UDP::stop ( )
pure virtual

This function is used to disconnect from the server. Release any resource being used during the UDP session.

Parameters
[in]None
[out]None
Returns
None
Note

Implemented in WiFiUDP.

◆ write() [1/2]

virtual size_t UDP::write ( uint8_t  )
pure virtual

This function is used to writes UDP data to the remote connection.

Parameters
[in]theoutgoing byte
[out]None
Return values
singlebyte into the packet
Note
Must be wrapped between beginPacket() and endPacket(). beginPacket() initializes the packet of data, it is not sent until endPacket() is called.

Implements Print.

Implemented in WiFiUDP.

◆ write() [2/2]

virtual size_t UDP::write ( const uint8_t *  buffer,
size_t  size 
)
pure virtual

This function is used to writes UDP data to the remote connection.

Parameters
[in]bufferthe outgoing message
[in]sizethe size of the buffer
[out]None
Return values
bytessize from buffer into the packet
Note
Must be wrapped between beginPacket() and endPacket(). beginPacket() initializes the packet of data, it is not sent until endPacket() is called.

Reimplemented from Print.

Implemented in WiFiUDP.

Generated by   doxygen 1.8.14