86 uint64_t
end = millis() + 2000;
87 while (millis() <
end) {
107 if (schedule !=
nullptr) {
170 postAlive1->
time = millis() + 100;
188 if (!
StrView(device_path).isEmpty()) {
209 service.scp_cb, ref, 1);
211 service.control_cb, ref, 1);
213 service.event_sub_cb, ref, 1);
223 assert(device_xml !=
nullptr);
224 if (device_xml !=
nullptr) {
225 Client& client = server->
client();
226 assert(&client !=
nullptr);
234 device_xml->
print(client);
#define DLNA_MAX_URL_LEN
Definition: DLNAServiceInfo.h:5
Setup of a Basic DLNA Device service. The device registers itself to the network and answers to the D...
Definition: DLNADeviceMgr.h:23
uint32_t post_alive_repeat_ms
Definition: DLNADeviceMgr.h:148
void setDevice(DLNADevice &device)
Definition: DLNADeviceMgr.h:150
DLNADevice * p_device
Definition: DLNADeviceMgr.h:144
bool is_active
Definition: DLNADeviceMgr.h:146
bool setupParser()
Definition: DLNADeviceMgr.h:154
bool isSchedulerActive()
Checks if the scheduler is active.
Definition: DLNADeviceMgr.h:134
DLNAServiceInfo getService(const char *id)
Provide addess to the service information.
Definition: DLNADeviceMgr.h:123
bool scheduler_active
Definition: DLNADeviceMgr.h:147
static void deviceXMLCallback(HttpServer *server, const char *requestPath, HttpRequestHandlerLine *hl)
callback to provide device XML
Definition: DLNADeviceMgr.h:220
virtual bool setupDLNAServer(HttpServer &srv)
set up Web Server to handle Service Addresses
Definition: DLNADeviceMgr.h:177
bool setupScheduler()
Schedule PostAlive messages.
Definition: DLNADeviceMgr.h:163
bool loop()
call this method in the Arduino loop as often as possible
Definition: DLNADeviceMgr.h:95
bool begin(DLNADevice &device, IUDPService &udp, HttpServer &server)
start the
Definition: DLNADeviceMgr.h:26
void setPostAliveRepeatMs(uint32_t ms)
Definition: DLNADeviceMgr.h:138
HttpServer * p_server
Definition: DLNADeviceMgr.h:145
void setSchedulerActive(bool flag)
We can activate/deactivate the scheduler.
Definition: DLNADeviceMgr.h:131
DLNADeviceRequestParser parser
Definition: DLNADeviceMgr.h:142
void end()
Stops the processing and releases the resources.
Definition: DLNADeviceMgr.h:77
virtual void setupServices(DLNADevice &deviceInfo)
Definition: DLNADeviceMgr.h:245
Scheduler scheduler
Definition: DLNADeviceMgr.h:141
IUDPService * p_udp
Definition: DLNADeviceMgr.h:143
DLNADevice & getDevice()
Provides the device.
Definition: DLNADeviceMgr.h:128
Translates DLNA UDP Requests to Schedule so that we can schedule a reply.
Definition: DLNADeviceRequestParser.h:15
Schedule * parse(DLNADevice &device, RequestData &req)
Definition: DLNADeviceRequestParser.h:20
void addMSearchST(const char *accept)
Definition: DLNADeviceRequestParser.h:18
Device Attributes and generation of XML using urn:schemas-upnp-org:device-1-0. We could just return a...
Definition: DLNADevice.h:27
Vector< DLNAServiceInfo > & getServices()
Definition: DLNADevice.h:123
DLNAServiceInfo & getService(const char *id)
Finds a service definition by name.
Definition: DLNADevice.h:113
virtual void setupServices(HttpServer &server, IUDPService &udp)
Definition: DLNADevice.h:164
Url & getDeviceURL()
This method returns base url/device.xml.
Definition: DLNADevice.h:67
void print(Print &out)
renderes the device xml
Definition: DLNADevice.h:36
const char * getBaseURL()
Provides the base url.
Definition: DLNADevice.h:58
const char * getDeviceType()
Definition: DLNADevice.h:46
Icon getIcon(int idx=0)
Definition: DLNADevice.h:143
const char * getUDN()
Provide the udn uuid.
Definition: DLNADevice.h:52
virtual void loop()
Definition: DLNADevice.h:160
Attributes needed for the DLNA Service Definition.
Definition: DLNAServiceInfo.h:16
Used to register and process callbacks.
Definition: HttpRequestHandlerLine.h:19
void ** context
Definition: HttpRequestHandlerLine.h:39
A Simple Header only implementation of Http Server that allows the registration of callback functions...
Definition: HttpServer.h:24
Client & client()
Provides the current client.
Definition: HttpServer.h:436
bool begin(int port, const char *ssid, const char *password)
Definition: HttpServer.h:49
bool doLoop()
Legacy method: same as copy();.
Definition: HttpServer.h:404
void on(const char *url, TinyMethodID method, web_callback_fn fn, void *ctx[]=nullptr, int ctxCount=0)
register a generic handler
Definition: HttpServer.h:89
void endClient()
closes the connection to the current client_ptr
Definition: HttpServer.h:386
void end()
stops the server_ptr
Definition: HttpServer.h:76
void replyNotFound()
write 404 reply
Definition: HttpServer.h:366
void rewrite(const char *from, const char *to)
adds a rewrite rule
Definition: HttpServer.h:82
HttpReplyHeader & replyHeader()
provides the reply header
Definition: HttpServer.h:383
Abstract Interface for UDP API.
Definition: IUDPService.h:34
virtual RequestData receive()=0
virtual bool begin(int port)=0
Information about the icon.
Definition: Icon.h:10
const char * icon_url
Definition: Icon.h:16
int icon_size
Definition: Icon.h:18
const char * mime
Definition: Icon.h:12
uint8_t * icon_data
Definition: Icon.h:17
void log(DlnaLogLevel current_level, const char *fmt...)
Print log message.
Definition: Logger.h:40
Send out PostAlive messages: Repeated every 5 seconds.
Definition: Schedule.h:163
Send out ByeBye message.
Definition: Schedule.h:235
Scheduler which processes all due Schedules (to send out UDP replies)
Definition: Scheduler.h:15
void execute(IUDPService &udp)
Execute all due schedules.
Definition: Scheduler.h:25
void add(Schedule *schedule)
Add a schedule to the scheduler.
Definition: Scheduler.h:18
A simple wrapper to provide string functions on char*. If the underlying char* is a const we do not a...
Definition: StrView.h:19
const char * buildPath(const char *start, const char *p1=nullptr, const char *p2=nullptr)
Definition: StrView.h:739
virtual bool contains(const char *str)
checks if the string contains a substring
Definition: StrView.h:279
URL parser which breaks a full url string up into its individual parts.
Definition: Url.h:18
const char * path()
Definition: Url.h:47
Definition: Allocator.h:6
const char * CONTENT_TYPE
Definition: HttpHeader.h:16
const char * CON_KEEP_ALIVE
Definition: HttpHeader.h:20
@ DlnaDebug
Definition: Logger.h:16
@ DlnaInfo
Definition: Logger.h:16
@ DlnaError
Definition: Logger.h:16
@ T_GET
Definition: HttpHeader.h:37
@ T_POST
Definition: HttpHeader.h:39
LoggerClass DlnaLogger
Definition: Logger.cpp:5
const char * CONNECTION
Definition: HttpHeader.h:18
Provides information of the received UDP which consists of the (xml) data and the peer address and po...
Definition: IUDPService.h:23
An individual Schedule (to send out UDP messages)
Definition: Schedule.h:17
uint64_t time
Definition: Schedule.h:20
uint32_t repeat_ms
Definition: Schedule.h:22