19 typedef void (*
XMLCallback)(
const char* name,
const char* test,
20 const char* attributes);
23 const char* newValue);
50 bool begin(uint32_t minWaitMs = 3000, uint32_t maxWaitMs = 60000) {
53 "DLNAControlPointMediaServer::begin: device_type_filter='%s'",
85 const char* dt = d.getDeviceType();
148 if (!svc)
return false;
176 int& numberReturned,
int& totalMatches,
int& updateID,
177 const char* searchCriteria =
"",
const char* filter =
"",
178 const char* sortCriteria =
"") {
184 if (!svc)
return false;
188 requestedCount, sortCriteria);
203 "ControlPointMediaServer::getSystemUpdateID");
213 return v ? atoi(v) : -1;
222 "ControlPointMediaServer::getSearchCapabilities");
225 if (!svc)
return nullptr;
239 "ControlPointMediaServer::getSortCapabilities");
242 if (!svc)
return nullptr;
256 "ControlPointMediaServer::getProtocolInfo");
259 if (!svc)
return nullptr;
282 "urn:schemas-upnp-org:device:MediaServer:1";
294 const char* varName,
const char* newValue) {
297 "processNotification sid='%s' var='%s' value='%s'",
298 sid ? sid :
"(null)", varName ? varName :
"(null)",
299 newValue ? newValue :
"(null)");
305 "ControlPointMediaServer::selectService: id='%s'",
id);
317 int startingIndex,
int requestedCount) {
320 :
"BrowseDirectChildren";
324 act.addArgument(
"BrowseFlag", browseFlag);
325 act.addArgument(
"Filter",
"");
327 snprintf(buf,
sizeof(buf),
"%d", startingIndex);
328 act.addArgument(
"StartingIndex", buf);
329 snprintf(buf,
sizeof(buf),
"%d", requestedCount);
330 act.addArgument(
"RequestedCount", buf);
331 act.addArgument(
"SortCriteria",
"");
337 const char* searchCriteria,
338 const char* filter,
int startingIndex,
340 const char* sortCriteria) {
342 act.addArgument(
"ContainerID",
object_id);
343 act.addArgument(
"SearchCriteria", searchCriteria ? searchCriteria :
"");
344 act.addArgument(
"Filter", filter ? filter :
"");
346 snprintf(buf,
sizeof(buf),
"%d", startingIndex);
347 act.addArgument(
"StartingIndex", buf);
348 snprintf(buf,
sizeof(buf),
"%d", requestedCount);
349 act.addArgument(
"RequestedCount", buf);
350 act.addArgument(
"SortCriteria", sortCriteria ? sortCriteria :
"");
356 int& totalMatches,
int& updateID) {
358 "ControlPointMediaServer::parseNumericFields");
359 const char* nret = reply.
findArgument(
"NumberReturned");
360 const char* tmatch = reply.
findArgument(
"TotalMatches");
362 numberReturned = nret ? atoi(nret) : 0;
363 totalMatches = tmatch ? atoi(tmatch) : 0;
364 updateID = uid ? atoi(uid) : 0;
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
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 setDeviceIndex(int idx)
Selects the default device by index.
Definition: DLNAControlPoint.h:84
void onResultNode(std::function< void(const char *nodeName, const char *text, const char *attributes)> cb)
Definition: DLNAControlPoint.h:108
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
Make sure that a string is stored only once.
Definition: StringRegistry.h:12
Definition: AllocationTracker.h:9
ContentQueryType
Type of content query for DLNA browsing/searching.
Definition: DLNACommon.h:36
LoggerClass DlnaLogger
Definition: Logger.cpp:5
std::function< void(Client &client, ActionReply &reply)> XMLCallback
Definition: DLNAControlPoint.h:22