Arduino DLNA Server
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
tiny_dlna::DLNAControlPointMgr Class Reference

Setup of a Basic DLNA Control Point. The control point. More...

#include <DLNAControlPointMgr.h>

Collaboration diagram for tiny_dlna::DLNAControlPointMgr:
Collaboration graph
[legend]

Public Member Functions

 DLNAControlPointMgr ()
 
void setParseDevice (bool flag)
 Requests the parsing of the device information. More...
 
void setLocalURL (Url url)
 Defines the lacal url (needed for subscriptions) More...
 
bool begin (DLNAHttpRequest &http, IUDPService &udp, const char *searchTarget="ssdp:all", uint32_t processingTime=0, bool stopWhenFound=true)
 
void end ()
 Stops the processing and releases the resources. More...
 
ActionRequestaddAction (ActionRequest act)
 Registers a method that will be called. More...
 
ActionReply executeActions ()
 Executes all registered methods. More...
 
bool subscribe (const char *serviceName, int seconds)
 Subscribe to changes. More...
 
bool loop ()
 
DLNAServiceInfogetService (const char *id)
 Provide addess to the service information. More...
 
DLNADevicegetDevice (int deviceIdx=0)
 Provides the device information by index. More...
 
DLNADevicegetDevice (DLNAServiceInfo &service)
 Provides the device for a service. More...
 
DLNADevicegetDevice (Url location)
 Get a device for a Url. More...
 
Vector< DLNADevice > & getDevices ()
 
bool addDevice (DLNADevice dev)
 Adds a new device. More...
 
bool addDevice (Url url)
 Adds the device from the device xml url if it does not already exist. More...
 
void setActive (bool flag)
 We can activate/deactivate the scheduler. More...
 
bool isActive ()
 Checks if the scheduler is active. More...
 

Protected Member Functions

bool matches (const char *usn)
 checks if the usn contains the search target More...
 
bool processBye (Str &usn)
 processes a bye-bye message More...
 
size_t createXML (ActionRequest &action)
 
ActionReply postAllActions ()
 
ActionReply postAction (ActionRequest &action)
 
const char * getUrl (DLNADevice &device, const char *suffix, const char *buffer, int len)
 

Static Protected Member Functions

static bool processDevice (NotifyReplyCP &data)
 Processes a NotifyReplyCP message. More...
 

Protected Attributes

Scheduler scheduler
 
DLNAHttpRequestp_http = nullptr
 
IUDPServicep_udp = nullptr
 
Vector< DLNADevicedevices
 
Vector< ActionRequestactions
 
XMLPrinter xml
 
bool is_active = false
 
bool is_parse_device = false
 
DLNADevice NO_DEVICE {false}
 
const char * search_target
 
StringRegistry strings
 
Url local_url
 

Detailed Description

Setup of a Basic DLNA Control Point. The control point.

The control point can also execute Actions

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ DLNAControlPointMgr()

tiny_dlna::DLNAControlPointMgr::DLNAControlPointMgr ( )
inline

Member Function Documentation

◆ addAction()

ActionRequest& tiny_dlna::DLNAControlPointMgr::addAction ( ActionRequest  act)
inline

Registers a method that will be called.

◆ addDevice() [1/2]

bool tiny_dlna::DLNAControlPointMgr::addDevice ( DLNADevice  dev)
inline

Adds a new device.

◆ addDevice() [2/2]

bool tiny_dlna::DLNAControlPointMgr::addDevice ( Url  url)
inline

Adds the device from the device xml url if it does not already exist.

◆ begin()

bool tiny_dlna::DLNAControlPointMgr::begin ( DLNAHttpRequest http,
IUDPService udp,
const char *  searchTarget = "ssdp:all",
uint32_t  processingTime = 0,
bool  stopWhenFound = true 
)
inline
 @brief start the processing by sending out a MSearch. For the search target
 you can use:
 - ssdp:all : to search all UPnP devices,
 - upnp:rootdevice: only root devices . Embedded devices will not respond
 - uuid:device-uuid: search a device by vendor supplied unique id
 - urn:schemas-upnp-org:device:deviceType- version: locates all devices of a

given type (as defined by working committee)

  • urn:schemas-upnp-org:service:serviceType- version: locate service of a given type

◆ createXML()

size_t tiny_dlna::DLNAControlPointMgr::createXML ( ActionRequest action)
inlineprotected

Creates the Action Soap XML request. E.g "<?xml version=\"1.0"?>\r
" "<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"\r
" "s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\r
" "<s:Body>\r
" "<u:SetTarget " "xmlns:u="urn:schemas-upnp-org:service:SwitchPower:1">\r
" "<newTargetValue>1</newTargetValue>\r
" "</u:SetTarget>\r
" "</s:Body>\r
" "</s:Envelope>\r
";

◆ end()

void tiny_dlna::DLNAControlPointMgr::end ( )
inline

Stops the processing and releases the resources.

◆ executeActions()

ActionReply tiny_dlna::DLNAControlPointMgr::executeActions ( )
inline

Executes all registered methods.

◆ getDevice() [1/3]

DLNADevice& tiny_dlna::DLNAControlPointMgr::getDevice ( DLNAServiceInfo service)
inline

Provides the device for a service.

◆ getDevice() [2/3]

DLNADevice& tiny_dlna::DLNAControlPointMgr::getDevice ( int  deviceIdx = 0)
inline

Provides the device information by index.

◆ getDevice() [3/3]

DLNADevice& tiny_dlna::DLNAControlPointMgr::getDevice ( Url  location)
inline

Get a device for a Url.

◆ getDevices()

Vector<DLNADevice>& tiny_dlna::DLNAControlPointMgr::getDevices ( )
inline

◆ getService()

DLNAServiceInfo& tiny_dlna::DLNAControlPointMgr::getService ( const char *  id)
inline

Provide addess to the service information.

◆ getUrl()

const char* tiny_dlna::DLNAControlPointMgr::getUrl ( DLNADevice device,
const char *  suffix,
const char *  buffer,
int  len 
)
inlineprotected

◆ isActive()

bool tiny_dlna::DLNAControlPointMgr::isActive ( )
inline

Checks if the scheduler is active.

◆ loop()

bool tiny_dlna::DLNAControlPointMgr::loop ( )
inline

call this method in the Arduino loop as often as possible: the processes all replys

◆ matches()

bool tiny_dlna::DLNAControlPointMgr::matches ( const char *  usn)
inlineprotected

checks if the usn contains the search target

◆ postAction()

ActionReply tiny_dlna::DLNAControlPointMgr::postAction ( ActionRequest action)
inlineprotected

◆ postAllActions()

ActionReply tiny_dlna::DLNAControlPointMgr::postAllActions ( )
inlineprotected

◆ processBye()

bool tiny_dlna::DLNAControlPointMgr::processBye ( Str usn)
inlineprotected

processes a bye-bye message

◆ processDevice()

static bool tiny_dlna::DLNAControlPointMgr::processDevice ( NotifyReplyCP data)
inlinestaticprotected

Processes a NotifyReplyCP message.

◆ setActive()

void tiny_dlna::DLNAControlPointMgr::setActive ( bool  flag)
inline

We can activate/deactivate the scheduler.

◆ setLocalURL()

void tiny_dlna::DLNAControlPointMgr::setLocalURL ( Url  url)
inline

Defines the lacal url (needed for subscriptions)

◆ setParseDevice()

void tiny_dlna::DLNAControlPointMgr::setParseDevice ( bool  flag)
inline

Requests the parsing of the device information.

◆ subscribe()

bool tiny_dlna::DLNAControlPointMgr::subscribe ( const char *  serviceName,
int  seconds 
)
inline

Subscribe to changes.

Member Data Documentation

◆ actions

Vector<ActionRequest> tiny_dlna::DLNAControlPointMgr::actions
protected

◆ devices

Vector<DLNADevice> tiny_dlna::DLNAControlPointMgr::devices
protected

◆ is_active

bool tiny_dlna::DLNAControlPointMgr::is_active = false
protected

◆ is_parse_device

bool tiny_dlna::DLNAControlPointMgr::is_parse_device = false
protected

◆ local_url

Url tiny_dlna::DLNAControlPointMgr::local_url
protected

◆ NO_DEVICE

DLNADevice tiny_dlna::DLNAControlPointMgr::NO_DEVICE {false}
protected

◆ p_http

DLNAHttpRequest* tiny_dlna::DLNAControlPointMgr::p_http = nullptr
protected

◆ p_udp

IUDPService* tiny_dlna::DLNAControlPointMgr::p_udp = nullptr
protected

◆ scheduler

Scheduler tiny_dlna::DLNAControlPointMgr::scheduler
protected

◆ search_target

const char* tiny_dlna::DLNAControlPointMgr::search_target
protected

◆ strings

StringRegistry tiny_dlna::DLNAControlPointMgr::strings
protected

◆ xml

XMLPrinter tiny_dlna::DLNAControlPointMgr::xml
protected

The documentation for this class was generated from the following file: