Arduino DLNA Server
Loading...
Searching...
No Matches
IUDPService.h
Go to the documentation of this file.
1#pragma once
2
3#include <WiFi.h>
4#include <WiFiUdp.h>
5
6#include "dlna_config.h"
8#include "basic/Str.h"
9#include "assert.h"
10
11namespace tiny_dlna {
12
13static IPAddressAndPort DLNABroadcastAddress{IPAddress(239, 255, 255, 250),
15
25 operator bool() { return !data.isEmpty(); }
26};
27
34 public:
35 virtual ~IUDPService() = default;
37 virtual bool begin(int port) = 0;
39 virtual bool begin(IPAddressAndPort addr) = 0;
41 virtual bool send(uint8_t* data, int len) = 0;
43 virtual bool send(IPAddressAndPort addr, uint8_t* data, int len) = 0;
45 virtual RequestData receive() = 0;
46};
47
48} // namespace tiny_dlna
Abstract Interface for UDP API.
Definition: IUDPService.h:33
virtual RequestData receive()=0
Receive incoming UDP data and peer information.
virtual bool send(IPAddressAndPort addr, uint8_t *data, int len)=0
Send data to specified address and port.
virtual bool begin(IPAddressAndPort addr)=0
Initialize UDP service on specified address and port.
virtual bool begin(int port)=0
Initialize UDP service on specified port.
virtual ~IUDPService()=default
virtual bool send(uint8_t *data, int len)=0
Send data to the default destination.
Heap-backed string utility used throughout tiny_dlna.
Definition: Str.h:27
bool isEmpty() const
True if empty.
Definition: Str.h:54
#define DLNA_SSDP_PORT
SSDP multicast/UDP port (default 1900)
Definition: dlna_config.h:40
Definition: Allocator.h:13
IP Adress including Port information.
Definition: IPAddressAndPort.h:20
Provides information of the received UDP which consists of the (xml) data and the peer address and po...
Definition: IUDPService.h:22
IPAddressAndPort peer
Definition: IUDPService.h:24
Str data
Definition: IUDPService.h:23