63 void setLocalURL(IPAddress url,
int port=9001,
const char* path=
"") {
75 bool begin(uint32_t minWaitMs = 3000, uint32_t maxWaitMs = 60000) {
77 "ControlPointMediaRenderer::begin - device_type_filter='%s'",
102 const char* dt = d.getDeviceType();
127 const char* newValue);
136 std::function<
void(
const char* sid,
const char* varName,
139 void* ref =
nullptr) {
214 if (!svc)
return false;
232 if (!svc)
return false;
250 if (volumePercent < 0) volumePercent = 0;
251 if (volumePercent > 100) volumePercent = 100;
259 snprintf(volBuf,
sizeof(volBuf),
"%d", volumePercent);
281 if (!svc)
return false;
379 if (!svc)
return nullptr;
401 if (!svc)
return nullptr;
526 if (!actions)
return false;
539 std::function<
void(
const char* entry,
ProtocolRole role)> cb) {
540 if (!cb)
return false;
560 reply.setValid(
true);
575 "urn:schemas-upnp-org:device:MediaRenderer:1";
598 const char* varName,
const char* newValue) {
601 "processNotification sid='%s' var='%s' value='%s'",
602 sid ? sid :
"(null)", varName ? varName :
"(null)",
603 newValue ? newValue :
"(null)");
609 if (
StrView(varName) ==
"TransportState") {
610 if (
StrView(newValue) ==
"PLAYING") {
621 if (t ==
nullptr)
return 0;
622 int h = 0, m = 0, s = 0;
628 if (*p ==
':') colonCount++;
631 if (colonCount == 2) {
632 parts = sscanf(t,
"%d:%d:%d", &h, &m, &s);
633 }
else if (colonCount == 1) {
634 parts = sscanf(t,
"%d:%d", &m, &s);
638 parts = sscanf(t,
"%d", &s);
640 if (parts <= 0)
return 0;
641 unsigned long total =
642 (
unsigned long)h * 3600UL + (
unsigned long)m * 60UL + (
unsigned long)s;
643 return total * 1000UL;
Represents the result of invoking a DLNA service Action.
Definition: Action.h:48
const char * findArgument(const char *name)
Definition: Action.h:70
Represents a request to invoke a remote DLNA service action.
Definition: Action.h:104
void addArgument(Argument arg)
Definition: Action.h:113
DLNA Service: Action Argument.
Definition: Action.h:17
Lightweight DLNA control point manager.
Definition: DLNAControlPoint.h:61
void setLocalURL(Url url) override
Defines the local url (needed for subscriptions)
Definition: DLNAControlPoint.h:89
DLNAServiceInfo & getService(const char *id) override
Provide addess to the service information.
Definition: DLNAControlPoint.h:361
void setEventSubscriptionCallback(std::function< void(const char *sid, const char *varName, const char *newValue, void *reference)> cb, void *ref=nullptr) override
Register a callback that will be invoked for incoming event notification.
Definition: DLNAControlPoint.h:110
DLNADeviceInfo & getDevice() override
Provides the device information of the actually selected device.
Definition: DLNAControlPoint.h:372
Vector< DLNADeviceInfo > & getDevices() override
Get list of all discovered devices.
Definition: DLNAControlPoint.h:414
void setNotificationsActive(bool flag) override
Activate/deactivate subscription notifications.
Definition: DLNAControlPoint.h:519
bool begin(const char *searchTarget="ssdp:all", uint32_t minWaitMs=3000, uint32_t maxWaitMs=60000) override
Start discovery with default HTTP/UDP services.
Definition: DLNAControlPoint.h:133
ActionReply & executeActions(XMLCallback xmlProcessor=nullptr) override
Executes action and parses the reply xml to collect the reply entries. If an XML processor is provide...
Definition: DLNAControlPoint.h:304
ActionRequest & addAction(ActionRequest act) override
Registers a method that will be called.
Definition: DLNAControlPoint.h:290
bool subscribe()
Subscribes to event notifications for all services of the selected device.
Definition: DLNAControlPoint.h:216
DLNAServiceInfo & getService(const char *id)
Finds a service definition by name.
Definition: DLNADeviceInfo.h:183
Attributes needed for the DLNA Service Definition.
Definition: DLNAServiceInfo.h:18
Abstract interface for HTTP client request functionality.
Definition: IHttpRequest.h:21
Abstract Interface for UDP API.
Definition: IUDPService.h:33
A simple wrapper to provide string functions on char*. If the underlying char* is a const we do not a...
Definition: StrView.h:18
Heap-backed string utility used throughout tiny_dlna.
Definition: Str.h:27
const char * c_str() const
C-string pointer to internal buffer.
Definition: Str.h:88
URL parser which breaks a full url string up into its individual parts.
Definition: Url.h:18
static bool parse(Stream &in, std::function< void(const char *entry, ProtocolRole role)> cb)
Definition: XMLProtocolInfoParser.h:41
Definition: Allocator.h:13
ProtocolRole
Role to indicate whether a protocolInfo entry is a Source or a Sink.
Definition: DLNACommon.h:26
std::function< void(Client &client, ActionReply &reply)> XMLCallback
Definition: IControlPoint.h:25