84 uint64_t
end = millis() + 2000;
85 while (millis() <
end) {
105 if (schedule !=
nullptr) {
168 postAlive1->
time = millis() + 100;
186 if (!
StrView(device_path).isEmpty()) {
207 service.scp_cb, ref, 1);
209 service.control_cb, ref, 1);
211 service.event_sub_cb, ref, 1);
221 assert(device_xml !=
nullptr);
222 if (device_xml !=
nullptr) {
223 Client& client = server->
client();
224 assert(&client !=
nullptr);
232 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:146
void setDevice(DLNADevice &device)
Definition: DLNADeviceMgr.h:148
DLNADevice * p_device
Definition: DLNADeviceMgr.h:142
bool is_active
Definition: DLNADeviceMgr.h:144
bool setupParser()
Definition: DLNADeviceMgr.h:152
bool isSchedulerActive()
Checks if the scheduler is active.
Definition: DLNADeviceMgr.h:132
DLNAServiceInfo getService(const char *id)
Provide addess to the service information.
Definition: DLNADeviceMgr.h:121
bool scheduler_active
Definition: DLNADeviceMgr.h:145
static void deviceXMLCallback(HttpServer *server, const char *requestPath, HttpRequestHandlerLine *hl)
callback to provide device XML
Definition: DLNADeviceMgr.h:218
virtual bool setupDLNAServer(HttpServer &srv)
set up Web Server to handle Service Addresses
Definition: DLNADeviceMgr.h:175
bool setupScheduler()
Schedule PostAlive messages.
Definition: DLNADeviceMgr.h:161
bool loop()
call this method in the Arduino loop as often as possible
Definition: DLNADeviceMgr.h:93
bool begin(DLNADevice &device, IUDPService &udp, HttpServer &server)
start the
Definition: DLNADeviceMgr.h:26
void setPostAliveRepeatMs(uint32_t ms)
Definition: DLNADeviceMgr.h:136
HttpServer * p_server
Definition: DLNADeviceMgr.h:143
void setSchedulerActive(bool flag)
We can activate/deactivate the scheduler.
Definition: DLNADeviceMgr.h:129
DLNADeviceRequestParser parser
Definition: DLNADeviceMgr.h:140
void end()
Stops the processing and releases the resources.
Definition: DLNADeviceMgr.h:75
virtual void setupServices(DLNADevice &deviceInfo)
Definition: DLNADeviceMgr.h:243
Scheduler scheduler
Definition: DLNADeviceMgr.h:139
IUDPService * p_udp
Definition: DLNADeviceMgr.h:141
DLNADevice & getDevice()
Provides the device.
Definition: DLNADeviceMgr.h:126
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:125
DLNAServiceInfo & getService(const char *id)
Finds a service definition by name.
Definition: DLNADevice.h:115
Url & getDeviceURL()
This method returns base url/device.xml.
Definition: DLNADevice.h:69
void print(Print &out)
renderes the device xml
Definition: DLNADevice.h:34
Url & getBaseURL()
Provides the base url.
Definition: DLNADevice.h:56
const char * getDeviceType()
Definition: DLNADevice.h:44
Icon getIcon(int idx=0)
Definition: DLNADevice.h:146
const char * getUDN()
Provide the udn uuid.
Definition: DLNADevice.h:50
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(IPAddressAndPort addr)=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:25
const char * buildPath(const char *start, const char *p1=nullptr, const char *p2=nullptr)
Definition: StrView.h:736
virtual bool equals(const char *str)
checks if the string equals indicated parameter string
Definition: StrView.h:171
URL parser which breaks a full url string up into its individual parts.
Definition: Url.h:18
const char * path()
Definition: Url.h:47
int port()
Definition: Url.h:51
const char * url()
Definition: Url.h:46
const char * host()
Definition: Url.h:48
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