19 typedef void (*
XMLCallback)(
const char* name,
const char* test,
20 const char* attributes);
23 const char* newValue);
47 void setLocalURL(IPAddress url,
int port=9001,
const char* path=
"") {
58 bool begin(uint32_t minWaitMs = 3000, uint32_t maxWaitMs = 60000) {
61 "DLNAControlPointMediaServer::begin: device_type_filter='%s'",
94 const char* dt = d.getDeviceType();
124 std::function<
void(
const char* sid,
const char* varName,
127 void* ref =
nullptr) {
170 if (!svc)
return false;
198 int& numberReturned,
int& totalMatches,
int& updateID,
199 const char* searchCriteria =
"",
const char* filter =
"",
200 const char* sortCriteria =
"") {
206 if (!svc)
return false;
210 requestedCount, sortCriteria);
225 "ControlPointMediaServer::getSystemUpdateID");
235 return v ? atoi(v) : -1;
244 "ControlPointMediaServer::getSearchCapabilities");
247 if (!svc)
return nullptr;
261 "ControlPointMediaServer::getSortCapabilities");
264 if (!svc)
return nullptr;
278 "ControlPointMediaServer::getProtocolInfo");
281 if (!svc)
return nullptr;
304 "urn:schemas-upnp-org:device:MediaServer:1";
315 const char* varName,
const char* newValue) {
318 "processNotification sid='%s' var='%s' value='%s'",
319 sid ? sid :
"(null)", varName ? varName :
"(null)",
320 newValue ? newValue :
"(null)");
326 "ControlPointMediaServer::selectService: id='%s'",
id);
338 int startingIndex,
int requestedCount) {
341 :
"BrowseDirectChildren";
345 act.addArgument(
"BrowseFlag", browseFlag);
346 act.addArgument(
"Filter",
"");
348 snprintf(buf,
sizeof(buf),
"%d", startingIndex);
349 act.addArgument(
"StartingIndex", buf);
350 snprintf(buf,
sizeof(buf),
"%d", requestedCount);
351 act.addArgument(
"RequestedCount", buf);
352 act.addArgument(
"SortCriteria",
"");
358 const char* searchCriteria,
359 const char* filter,
int startingIndex,
361 const char* sortCriteria) {
363 act.addArgument(
"ContainerID",
object_id);
364 act.addArgument(
"SearchCriteria", searchCriteria ? searchCriteria :
"");
365 act.addArgument(
"Filter", filter ? filter :
"");
367 snprintf(buf,
sizeof(buf),
"%d", startingIndex);
368 act.addArgument(
"StartingIndex", buf);
369 snprintf(buf,
sizeof(buf),
"%d", requestedCount);
370 act.addArgument(
"RequestedCount", buf);
371 act.addArgument(
"SortCriteria", sortCriteria ? sortCriteria :
"");
377 int& totalMatches,
int& updateID) {
379 "ControlPointMediaServer::parseNumericFields");
380 const char* nret = reply.
findArgument(
"NumberReturned");
381 const char* tmatch = reply.
findArgument(
"TotalMatches");
383 numberReturned = nret ? atoi(nret) : 0;
384 totalMatches = tmatch ? atoi(tmatch) : 0;
385 updateID = uid ? atoi(uid) : 0;
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
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 setDeviceIndex(int idx) override
Selects the default device by index.
Definition: DLNAControlPoint.h:107
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
void onResultNode(std::function< void(const char *nodeName, const char *text, const char *attributes)> cb) override
Definition: DLNAControlPoint.h:127
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
URL parser which breaks a full url string up into its individual parts.
Definition: Url.h:18
Definition: Allocator.h:13
ContentQueryType
Type of content query for DLNA browsing/searching.
Definition: DLNACommon.h:36
std::function< void(Client &client, ActionReply &reply)> XMLCallback
Definition: IControlPoint.h:25