Arduino DLNA Server
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
tiny_dlna::DLNADeviceMgr Class Reference

Setup of a Basic DLNA Device service. The device registers itself to the network and answers to the DLNA queries and requests. A DLNA device uses UDP, Http, XML and Soap to discover and manage a service, so there is quite some complexity involved: More...

#include <DLNADeviceMgr.h>

Inheritance diagram for tiny_dlna::DLNADeviceMgr:
Inheritance graph
[legend]
Collaboration diagram for tiny_dlna::DLNADeviceMgr:
Collaboration graph
[legend]

Public Member Functions

bool begin (DLNADevice &device, IUDPService &udp, HttpServer &server)
 start the More...
 
void end ()
 Stops the processing and releases the resources. More...
 
bool loop ()
 call this method in the Arduino loop as often as possible More...
 
DLNAServiceInfo getService (const char *id)
 Provide addess to the service information. More...
 
DLNADevicegetDevice ()
 Provides the device. More...
 
void setSchedulerActive (bool flag)
 We can activate/deactivate the scheduler. More...
 
bool isSchedulerActive ()
 Checks if the scheduler is active. More...
 
void setPostAliveRepeatMs (uint32_t ms)
 

Protected Member Functions

void setDevice (DLNADevice &device)
 
bool setupParser ()
 
bool setupScheduler ()
 Schedule PostAlive messages. More...
 
virtual bool setupDLNAServer (HttpServer &srv)
 set up Web Server to handle Service Addresses More...
 
virtual void setupServices (DLNADevice &deviceInfo)
 

Static Protected Member Functions

static void deviceXMLCallback (HttpServer *server, const char *requestPath, HttpRequestHandlerLine *hl)
 callback to provide device XML More...
 

Protected Attributes

Scheduler scheduler
 
DLNADeviceRequestParser parser
 
IUDPServicep_udp = nullptr
 
DLNADevicep_device = nullptr
 
HttpServerp_server = nullptr
 
bool is_active = false
 
bool scheduler_active = true
 
uint32_t post_alive_repeat_ms = 0
 

Detailed Description

Setup of a Basic DLNA Device service. The device registers itself to the network and answers to the DLNA queries and requests. A DLNA device uses UDP, Http, XML and Soap to discover and manage a service, so there is quite some complexity involved:

Member Function Documentation

◆ begin()

bool tiny_dlna::DLNADeviceMgr::begin ( DLNADevice device,
IUDPService udp,
HttpServer server 
)
inline

start the

◆ deviceXMLCallback()

static void tiny_dlna::DLNADeviceMgr::deviceXMLCallback ( HttpServer server,
const char *  requestPath,
HttpRequestHandlerLine hl 
)
inlinestaticprotected

callback to provide device XML

◆ end()

void tiny_dlna::DLNADeviceMgr::end ( )
inline

Stops the processing and releases the resources.

◆ getDevice()

DLNADevice& tiny_dlna::DLNADeviceMgr::getDevice ( )
inline

Provides the device.

◆ getService()

DLNAServiceInfo tiny_dlna::DLNADeviceMgr::getService ( const char *  id)
inline

Provide addess to the service information.

◆ isSchedulerActive()

bool tiny_dlna::DLNADeviceMgr::isSchedulerActive ( )
inline

Checks if the scheduler is active.

◆ loop()

bool tiny_dlna::DLNADeviceMgr::loop ( )
inline

call this method in the Arduino loop as often as possible

◆ setDevice()

void tiny_dlna::DLNADeviceMgr::setDevice ( DLNADevice device)
inlineprotected

◆ setPostAliveRepeatMs()

void tiny_dlna::DLNADeviceMgr::setPostAliveRepeatMs ( uint32_t  ms)
inline

Repeat the post-alive messages (default: 0 = no repeat). Call this method before calling begin!

◆ setSchedulerActive()

void tiny_dlna::DLNADeviceMgr::setSchedulerActive ( bool  flag)
inline

We can activate/deactivate the scheduler.

◆ setupDLNAServer()

virtual bool tiny_dlna::DLNADeviceMgr::setupDLNAServer ( HttpServer srv)
inlineprotectedvirtual

set up Web Server to handle Service Addresses

◆ setupParser()

bool tiny_dlna::DLNADeviceMgr::setupParser ( )
inlineprotected

MSearch requests reply to upnp:rootdevice and the device type defined in the device

◆ setupScheduler()

bool tiny_dlna::DLNADeviceMgr::setupScheduler ( )
inlineprotected

Schedule PostAlive messages.

◆ setupServices()

virtual void tiny_dlna::DLNADeviceMgr::setupServices ( DLNADevice deviceInfo)
inlineprotectedvirtual

If you dont already provid a complete DLNADevice you can overwrite this method and add some custom device specific logic to implement a new device. The MediaRenderer is using this approach!

Reimplemented in tiny_dlna::MediaRenderer.

Member Data Documentation

◆ is_active

bool tiny_dlna::DLNADeviceMgr::is_active = false
protected

◆ p_device

DLNADevice* tiny_dlna::DLNADeviceMgr::p_device = nullptr
protected

◆ p_server

HttpServer* tiny_dlna::DLNADeviceMgr::p_server = nullptr
protected

◆ p_udp

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

◆ parser

DLNADeviceRequestParser tiny_dlna::DLNADeviceMgr::parser
protected

◆ post_alive_repeat_ms

uint32_t tiny_dlna::DLNADeviceMgr::post_alive_repeat_ms = 0
protected

◆ scheduler

Scheduler tiny_dlna::DLNADeviceMgr::scheduler
protected

◆ scheduler_active

bool tiny_dlna::DLNADeviceMgr::scheduler_active = true
protected

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