|
Arduino DLNA Server
|
Helper class to control/query a MediaServer from a control point. More...
#include <ControlPointMediaServer.h>

Public Types | |
| typedef void(* | ItemCallback) (const MediaItem &item, void *ref) |
| typedef void(* | NotificationCallback) (void *reference, const char *sid, const char *varName, const char *newValue) |
Public Member Functions | |
| ControlPointMediaServer (DLNAControlPointMgr &mgr) | |
| Construct helper with reference to control point manager. | |
| bool | begin (DLNAHttpRequest &http, IUDPService &udp, uint32_t minWaitMs=3000, uint32_t maxWaitMs=60000) |
| Begin discovery and processing (forwards to underlying control point) | |
| int | getDeviceCount () |
| Return number of discovered devices known to the control point. | |
| const ActionReply & | getLastReply () const |
| Return the ActionReply from the last synchronous request. | |
| void | setDeviceIndex (int idx) |
| Select a device by index (0-based) for subsequent actions. | |
| bool | subscribeNotifications (int timeoutSeconds=60, NotificationCallback cb=nullptr) |
| Subscribe to event notifications for the selected server/device. | |
| void | setDeviceTypeFilter (const char *filter) |
| Restrict this helper to devices of the given device type. | |
| void | setReference (void *ref) |
| Attach an opaque reference pointer passed to callbacks. | |
| bool | browse (int startingIndex, int requestedCount, ItemCallback itemCallback, int &numberReturned, int &totalMatches, int &updateID, const char *browseFlag=nullptr) |
| Browse the given object_id and invoke callback for each returned item. | |
| int | getSystemUpdateID () |
| Get current SystemUpdateID for the ContentDirectory. | |
| const char * | getSearchCapabilities () |
| Get the ContentDirectory SearchCapabilities string. | |
| const char * | getSortCapabilities () |
| Get the ContentDirectory SortCapabilities string. | |
| const char * | getProtocolInfo () |
| Query ConnectionManager:GetProtocolInfo. | |
| void | setObjectID (const char *id) |
| Set the object id used for browse operations (default: "0") | |
| const char * | getObjectID () const |
| Return the current object id used for browse. | |
Protected Member Functions | |
| DLNAServiceInfo & | selectService (const char *id) |
| Select service by id. | |
| const char * | findArgument (ActionReply &r, const char *name) |
| ActionRequest & | createBrowseAction (DLNAServiceInfo &svc, const char *browseFlag, int startingIndex, int requestedCount) |
| Build a Browse ActionRequest. | |
| void | parseNumericFields (ActionReply &reply, int &numberReturned, int &totalMatches, int &updateID) |
| Parse numeric result fields from an ActionReply. | |
| void | processResult (const char *resultXml, ItemCallback itemCallback) |
| Parse DIDL-Lite Result and invoke callback for each item. | |
Static Protected Member Functions | |
| static void | processNotification (void *reference, const char *sid, const char *varName, const char *newValue) |
| Notification callback: just log for now. | |
Protected Attributes | |
| DLNAControlPointMgr & | mgr |
| int | device_index = 0 |
| const char * | device_type_filter_default |
| const char * | device_type_filter = device_type_filter_default |
| ActionReply | last_reply |
| StringRegistry | strings |
| void * | reference = nullptr |
| const char * | object_id = "0" |
Helper class to control/query a MediaServer from a control point.
Provides convenient wrappers around common ContentDirectory and ConnectionManager actions (Browse, GetSystemUpdateID, GetSearchCapabilities, GetProtocolInfo). Methods are synchronous and return boolean success or populate output parameters.
| typedef void(* tiny_dlna::ControlPointMediaServer::ItemCallback) (const MediaItem &item, void *ref) |
| typedef void(* tiny_dlna::ControlPointMediaServer::NotificationCallback) (void *reference, const char *sid, const char *varName, const char *newValue) |
|
inline |
Construct helper with reference to control point manager.
| mgr | Reference to DLNAControlPointMgr used to send actions and manage discovery/subscriptions |
|
inline |
Begin discovery and processing (forwards to underlying control point)
| http | Http server wrapper used for subscription callbacks |
| udp | UDP service used for SSDP discovery |
| minWaitMs | Minimum time in milliseconds to wait before returning |
| maxWaitMs | Maximum time in milliseconds to wait for discovery |
|
inline |
Browse the given object_id and invoke callback for each returned item.
| startingIndex | Starting index for the browse request |
| requestedCount | Number of items requested |
| itemCallback | Callback invoked per MediaItem result (may be nullptr) |
| numberReturned | Output: number of items returned by server |
| totalMatches | Output: total matches available on server |
| updateID | Output: server UpdateID |
| browseFlag | Optional BrowseFlag (defaults to BrowseDirectChildren) |
|
inlineprotected |
Build a Browse ActionRequest.
|
inlineprotected |
|
inline |
Return number of discovered devices known to the control point.
|
inline |
Return the ActionReply from the last synchronous request.
|
inline |
Return the current object id used for browse.
|
inline |
Query ConnectionManager:GetProtocolInfo.
|
inline |
Get the ContentDirectory SearchCapabilities string.
|
inline |
Get the ContentDirectory SortCapabilities string.
|
inline |
Get current SystemUpdateID for the ContentDirectory.
|
inlineprotected |
Parse numeric result fields from an ActionReply.
|
inlinestaticprotected |
Notification callback: just log for now.
|
inlineprotected |
Parse DIDL-Lite Result and invoke callback for each item.
|
inlineprotected |
Select service by id.
|
inline |
Select a device by index (0-based) for subsequent actions.
| idx | Device index |
|
inline |
Restrict this helper to devices of the given device type.
| filter | Device type string (e.g. "urn:schemas-upnp-org:device:MediaServer:1") Pass nullptr to restore the default filter |
|
inline |
Set the object id used for browse operations (default: "0")
| id | C-string object id |
|
inline |
Attach an opaque reference pointer passed to callbacks.
| ref | Opaque user pointer |
|
inline |
Subscribe to event notifications for the selected server/device.
| timeoutSeconds | Subscription timeout in seconds (default: 60) |
| cb | Optional notification callback; if nullptr the default processNotification will be used |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |