Arduino DLNA Server
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
tiny_dlna::UDPService< UDPType > Class Template Reference

Access to UDP functionality: sending and receiving of data. More...

#include <UDPService.h>

Inheritance diagram for tiny_dlna::UDPService< UDPType >:
Inheritance graph
[legend]

Public Member Functions

 UDPService ()=default
 
bool begin (int port) override
 Initialize UDP service on specified port.
 
bool begin (IPAddressAndPort addr) override
 Initialize UDP service on specified address and port.
 
bool send (uint8_t *data, int len) override
 Send data to the default destination.
 
bool send (IPAddressAndPort addr, uint8_t *data, int len) override
 Send data to specified address and port.
 
RequestData receive () override
 Receive incoming UDP data and peer information.
 

Protected Attributes

UDPType udp
 
IPAddressAndPort peer
 
bool is_multicast = false
 

Detailed Description

template<typename UDPType>
class tiny_dlna::UDPService< UDPType >

Access to UDP functionality: sending and receiving of data.

This class is a template and requires you to specify the UDP implementation type. For example, use UDPService<WiFiUDP> for WiFiUDP or UDPService<MyUDPType> for a custom UDP class.

Usage: UDPService<WiFiUDP> udp; // Uses WiFiUDP UDPService<MyUDPType> udp2; // Uses custom UDP type

Implements IUDPService for sending and receiving UDP packets, including multicast support.

Template Parameters
UDPTypeArduino UDP implementation that provides the standard UDP interface (e.g. WiFiUDP, EthernetUDP).
Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ UDPService()

template<typename UDPType >
tiny_dlna::UDPService< UDPType >::UDPService ( )
default

Member Function Documentation

◆ begin() [1/2]

template<typename UDPType >
bool tiny_dlna::UDPService< UDPType >::begin ( int  port)
inlineoverridevirtual

Initialize UDP service on specified port.

Implements tiny_dlna::IUDPService.

◆ begin() [2/2]

template<typename UDPType >
bool tiny_dlna::UDPService< UDPType >::begin ( IPAddressAndPort  addr)
inlineoverridevirtual

Initialize UDP service on specified address and port.

Implements tiny_dlna::IUDPService.

◆ receive()

template<typename UDPType >
RequestData tiny_dlna::UDPService< UDPType >::receive ( )
inlineoverridevirtual

Receive incoming UDP data and peer information.

Implements tiny_dlna::IUDPService.

◆ send() [1/2]

template<typename UDPType >
bool tiny_dlna::UDPService< UDPType >::send ( IPAddressAndPort  addr,
uint8_t *  data,
int  len 
)
inlineoverridevirtual

Send data to specified address and port.

Implements tiny_dlna::IUDPService.

◆ send() [2/2]

template<typename UDPType >
bool tiny_dlna::UDPService< UDPType >::send ( uint8_t *  data,
int  len 
)
inlineoverridevirtual

Send data to the default destination.

Implements tiny_dlna::IUDPService.

Member Data Documentation

◆ is_multicast

template<typename UDPType >
bool tiny_dlna::UDPService< UDPType >::is_multicast = false
protected

◆ peer

template<typename UDPType >
IPAddressAndPort tiny_dlna::UDPService< UDPType >::peer
protected

◆ udp

template<typename UDPType >
UDPType tiny_dlna::UDPService< UDPType >::udp
protected

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