69 bool begin(uint32_t minWaitMs = 3000, uint32_t maxWaitMs = 60000) {
71 "ControlPointMediaRenderer::begin - device_type_filter='%s'",
96 const char* dt = d.getDeviceType();
117 const char* newValue);
194 if (!svc)
return false;
212 if (!svc)
return false;
230 if (volumePercent < 0) volumePercent = 0;
231 if (volumePercent > 100) volumePercent = 100;
239 snprintf(volBuf,
sizeof(volBuf),
"%d", volumePercent);
261 if (!svc)
return false;
359 if (!svc)
return nullptr;
381 if (!svc)
return nullptr;
506 if (!actions)
return false;
519 std::function<
void(
const char* entry,
ProtocolRole role)> cb) {
520 if (!cb)
return false;
540 reply.setValid(
true);
555 "urn:schemas-upnp-org:device:MediaRenderer:1";
578 const char* varName,
const char* newValue) {
581 "processNotification sid='%s' var='%s' value='%s'",
582 sid ? sid :
"(null)", varName ? varName :
"(null)",
583 newValue ? newValue :
"(null)");
589 if (
StrView(varName) ==
"TransportState") {
590 if (
StrView(newValue) ==
"PLAYING") {
601 if (t ==
nullptr)
return 0;
602 int h = 0, m = 0, s = 0;
608 if (*p ==
':') colonCount++;
611 if (colonCount == 2) {
612 parts = sscanf(t,
"%d:%d:%d", &h, &m, &s);
613 }
else if (colonCount == 1) {
614 parts = sscanf(t,
"%d:%d", &m, &s);
618 parts = sscanf(t,
"%d", &s);
620 if (parts <= 0)
return 0;
621 unsigned long total =
622 (
unsigned long)h * 3600UL + (
unsigned long)m * 60UL + (
unsigned long)s;
623 return total * 1000UL;
Represents the result of invoking a DLNA service Action.
Definition: Action.h:50
const char * findArgument(const char *name)
Definition: Action.h:72
Represents a request to invoke a remote DLNA service action.
Definition: Action.h:109
void addArgument(Argument arg)
Definition: Action.h:118
DLNA Service: Action Argument.
Definition: Action.h:19
Lightweight DLNA control point manager.
Definition: DLNAControlPoint.h:62
ActionRequest & addAction(ActionRequest act)
Registers a method that will be called.
Definition: DLNAControlPoint.h:243
DLNADeviceInfo & getDevice()
Provides the device information of the actually selected device.
Definition: DLNAControlPoint.h:325
Vector< DLNADeviceInfo > & getDevices()
Definition: DLNAControlPoint.h:365
bool begin(DLNAHttpRequest &http, IUDPService &udp, const char *searchTarget="ssdp:all", uint32_t minWaitMs=3000, uint32_t maxWaitMs=60000)
Start discovery by sending M-SEARCH requests and process replies.
Definition: DLNAControlPoint.h:126
DLNAServiceInfo & getService(const char *id)
Provide addess to the service information.
Definition: DLNAControlPoint.h:314
void setSubscribeNotificationsActive(bool flag)
Activate/deactivate subscription notifications.
Definition: DLNAControlPoint.h:470
ActionReply & executeActions(XMLCallback xmlProcessor=nullptr)
Executes action and parses the reply xml to collect the reply entries. If an XML processor is provide...
Definition: DLNAControlPoint.h:257
DLNAServiceInfo & getService(const char *id)
Finds a service definition by name.
Definition: DLNADeviceInfo.h:146
Attributes needed for the DLNA Service Definition.
Definition: DLNAServiceInfo.h:16
Simple API to process get, put, post, del http requests I tried to use Arduino HttpClient,...
Definition: HttpRequest.h:23
Abstract Interface for UDP API.
Definition: IUDPService.h:33
void log(DlnaLogLevel current_level, const char *fmt...)
Print log message.
Definition: Logger.h:40
A simple wrapper to provide string functions on char*. If the underlying char* is a const we do not a...
Definition: StrView.h:18
String implementation which keeps the data on the heap. We grow the allocated memory only if the copy...
Definition: Str.h:22
const char * c_str() const
Definition: Str.h:186
static bool parse(Stream &in, std::function< void(const char *entry, ProtocolRole role)> cb)
Definition: XMLProtocolInfoParser.h:41
Definition: AllocationTracker.h:9
ProtocolRole
Role to indicate whether a protocolInfo entry is a Source or a Sink.
Definition: DLNACommon.h:26
LoggerClass DlnaLogger
Definition: Logger.cpp:5
std::function< void(Client &client, ActionReply &reply)> XMLCallback
Definition: DLNAControlPoint.h:22