Arduino DLNA Server
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
tiny_dlna::DLNADeviceInfo Class Reference

Device Attributes and generation of XML using urn:schemas-upnp-org:device-1-0. We could just return a predefined device xml document, but we provide a dynamic generation of the service xml which should be more memory efficient. Strings are represented as char*, so you can assign values that are stored in ProgMem to minimize the RAM usage. If you need to keep the values on the heap you can use addString() method. More...

#include <DLNADeviceInfo.h>

Inheritance diagram for tiny_dlna::DLNADeviceInfo:
Inheritance graph
[legend]

Public Member Functions

 DLNADeviceInfo (bool ok=true)
 
 DLNADeviceInfo (const DLNADeviceInfo &other)
 
 ~DLNADeviceInfo ()
 
virtual bool begin ()
 Override to initialize the device.
 
size_t print (Print &out, void *ref=nullptr)
 renders the device xml into the provided Print output.
 
void setDeviceType (const char *st)
 
const char * getDeviceType ()
 
void setUDN (const char *id)
 Define the udn uuid.
 
const char * getUDN ()
 Provide the udn uuid.
 
void setBaseURL (const char *url)
 Defines the base url.
 
void setBaseURL (IPAddress ip, int port, const char *path=nullptr)
 Defines the base URL.
 
const char * getBaseURL ()
 Provides the base url.
 
UrlgetDeviceURL ()
 This method returns base url/device.xml.
 
void setIPAddress (IPAddress address)
 Defines the local IP address.
 
IPAddress getIPAddress ()
 Provides the local IP address.
 
const char * getIPStr ()
 Provides the local address as string.
 
void setNS (const char *ns)
 
const char * getNS ()
 
void setFriendlyName (const char *name)
 
const char * getFriendlyName ()
 
void setManufacturer (const char *man)
 
const char * getManufacturer ()
 
void setManufacturerURL (const char *url)
 
const char * getManufacturerURL ()
 
void setModelDescription (const char *descr)
 
const char * getModelDescription ()
 
void setModelName (const char *name)
 
const char * getModelName ()
 
void setModelNumber (const char *number)
 
const char * getModelNumber ()
 
void setSerialNumber (const char *sn)
 
const char * getSerialNumber ()
 
void setUniversalProductCode (const char *upc)
 
const char * getUniversalProductCode ()
 
void addService (DLNAServiceInfo s)
 Adds a service definition.
 
DLNAServiceInfogetService (const char *id)
 Finds a service definition by name.
 
DLNAServiceInfogetServiceByAbbrev (const char *abbrev)
 Finds a service definition by name.
 
Vector< DLNAServiceInfo > & getServices ()
 Provides all service definitions.
 
void clear ()
 Clears all device information.
 
void clearIcons ()
 Overwrite the default icon.
 
void addIcon (Icon icon)
 adds an icon
 
Icon getIcon (int idx=0)
 Provides the item at indix.
 
void setActive (bool flag)
 Sets the server to inactive.
 
 operator bool ()
 return true if active
 
virtual bool loop ()
 loop processing
 
void setSubscriptionActive (bool flag)
 
bool isSubscriptionActive ()
 

Protected Member Functions

virtual void setupServices (IHttpServer &server, IUDPService &udp)
 to be implemented by subclasses
 
size_t printRoot (Print &out, void *ref)
 
size_t printDevice (Print &out, void *ref)
 
size_t printSpecVersion (Print &out, void *ref)
 
size_t printServiceList (Print &out, void *ref)
 
size_t printService (Print &out, void *srv)
 
size_t printIconList (Print &out, void *ref)
 
size_t printIconDlnaInfo (Print &out, Icon *icon)
 

Protected Attributes

bool is_active = false
 
Url device_url
 
IPAddress localhost
 
int version_major = 1
 
int version_minor = 0
 
Str base_url = "http://localhost:9876/dlna"
 
Str udn = "uuid:09349455-2941-4cf7-9847-0dd5ab210e97"
 
Str ns = "xmlns=\"urn:schemas-upnp-org:device-1-0\""
 
Str device_type
 
Str friendly_name
 
Str manufacturer
 
Str manufacturer_url
 
Str model_description
 
Str model_name
 
Str model_url
 
Str model_number
 
Str serial_number
 
Str universal_product_code
 
Icon icon
 
Vector< DLNAServiceInfoservices
 
Vector< Iconicons
 
Str url_str
 
bool is_subcription_active = false
 

Friends

class XMLDeviceParser
 
class DLNAControlPoint
 
template<typename >
class DLNADevice
 

Detailed Description

Device Attributes and generation of XML using urn:schemas-upnp-org:device-1-0. We could just return a predefined device xml document, but we provide a dynamic generation of the service xml which should be more memory efficient. Strings are represented as char*, so you can assign values that are stored in ProgMem to minimize the RAM usage. If you need to keep the values on the heap you can use addString() method.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ DLNADeviceInfo() [1/2]

tiny_dlna::DLNADeviceInfo::DLNADeviceInfo ( bool  ok = true)
inline

◆ DLNADeviceInfo() [2/2]

tiny_dlna::DLNADeviceInfo::DLNADeviceInfo ( const DLNADeviceInfo other)
inline

◆ ~DLNADeviceInfo()

tiny_dlna::DLNADeviceInfo::~DLNADeviceInfo ( )
inline

Member Function Documentation

◆ addIcon()

void tiny_dlna::DLNADeviceInfo::addIcon ( Icon  icon)
inline

adds an icon

◆ addService()

void tiny_dlna::DLNADeviceInfo::addService ( DLNAServiceInfo  s)
inline

Adds a service definition.

◆ begin()

virtual bool tiny_dlna::DLNADeviceInfo::begin ( )
inlinevirtual

Override to initialize the device.

Reimplemented in tiny_dlna::DLNAMediaRenderer< ClientType >, and tiny_dlna::DLNAMediaServer< ClientType >.

◆ clear()

void tiny_dlna::DLNADeviceInfo::clear ( )
inline

Clears all device information.

◆ clearIcons()

void tiny_dlna::DLNADeviceInfo::clearIcons ( )
inline

Overwrite the default icon.

◆ getBaseURL()

const char * tiny_dlna::DLNADeviceInfo::getBaseURL ( )
inline

Provides the base url.

◆ getDeviceType()

const char * tiny_dlna::DLNADeviceInfo::getDeviceType ( )
inline

◆ getDeviceURL()

Url & tiny_dlna::DLNADeviceInfo::getDeviceURL ( )
inline

This method returns base url/device.xml.

◆ getFriendlyName()

const char * tiny_dlna::DLNADeviceInfo::getFriendlyName ( )
inline

◆ getIcon()

Icon tiny_dlna::DLNADeviceInfo::getIcon ( int  idx = 0)
inline

Provides the item at indix.

◆ getIPAddress()

IPAddress tiny_dlna::DLNADeviceInfo::getIPAddress ( )
inline

Provides the local IP address.

◆ getIPStr()

const char * tiny_dlna::DLNADeviceInfo::getIPStr ( )
inline

Provides the local address as string.

◆ getManufacturer()

const char * tiny_dlna::DLNADeviceInfo::getManufacturer ( )
inline

◆ getManufacturerURL()

const char * tiny_dlna::DLNADeviceInfo::getManufacturerURL ( )
inline

◆ getModelDescription()

const char * tiny_dlna::DLNADeviceInfo::getModelDescription ( )
inline

◆ getModelName()

const char * tiny_dlna::DLNADeviceInfo::getModelName ( )
inline

◆ getModelNumber()

const char * tiny_dlna::DLNADeviceInfo::getModelNumber ( )
inline

◆ getNS()

const char * tiny_dlna::DLNADeviceInfo::getNS ( )
inline

◆ getSerialNumber()

const char * tiny_dlna::DLNADeviceInfo::getSerialNumber ( )
inline

◆ getService()

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

Finds a service definition by name.

◆ getServiceByAbbrev()

DLNAServiceInfo & tiny_dlna::DLNADeviceInfo::getServiceByAbbrev ( const char *  abbrev)
inline

Finds a service definition by name.

◆ getServices()

Vector< DLNAServiceInfo > & tiny_dlna::DLNADeviceInfo::getServices ( )
inline

Provides all service definitions.

◆ getUDN()

const char * tiny_dlna::DLNADeviceInfo::getUDN ( )
inline

Provide the udn uuid.

◆ getUniversalProductCode()

const char * tiny_dlna::DLNADeviceInfo::getUniversalProductCode ( )
inline

◆ isSubscriptionActive()

bool tiny_dlna::DLNADeviceInfo::isSubscriptionActive ( )
inline

◆ loop()

virtual bool tiny_dlna::DLNADeviceInfo::loop ( )
inlinevirtual

loop processing

◆ operator bool()

tiny_dlna::DLNADeviceInfo::operator bool ( )
inline

return true if active

◆ print()

size_t tiny_dlna::DLNADeviceInfo::print ( Print &  out,
void *  ref = nullptr 
)
inline

renders the device xml into the provided Print output.

Parameters
outPrint target
refoptional context pointer (passed through to callbacks)

◆ printDevice()

size_t tiny_dlna::DLNADeviceInfo::printDevice ( Print &  out,
void *  ref 
)
inlineprotected

◆ printIconDlnaInfo()

size_t tiny_dlna::DLNADeviceInfo::printIconDlnaInfo ( Print &  out,
Icon icon 
)
inlineprotected

◆ printIconList()

size_t tiny_dlna::DLNADeviceInfo::printIconList ( Print &  out,
void *  ref 
)
inlineprotected

◆ printRoot()

size_t tiny_dlna::DLNADeviceInfo::printRoot ( Print &  out,
void *  ref 
)
inlineprotected

◆ printService()

size_t tiny_dlna::DLNADeviceInfo::printService ( Print &  out,
void *  srv 
)
inlineprotected

◆ printServiceList()

size_t tiny_dlna::DLNADeviceInfo::printServiceList ( Print &  out,
void *  ref 
)
inlineprotected

◆ printSpecVersion()

size_t tiny_dlna::DLNADeviceInfo::printSpecVersion ( Print &  out,
void *  ref 
)
inlineprotected

◆ setActive()

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

Sets the server to inactive.

◆ setBaseURL() [1/2]

void tiny_dlna::DLNADeviceInfo::setBaseURL ( const char *  url)
inline

Defines the base url.

◆ setBaseURL() [2/2]

void tiny_dlna::DLNADeviceInfo::setBaseURL ( IPAddress  ip,
int  port,
const char *  path = nullptr 
)
inline

Defines the base URL.

◆ setDeviceType()

void tiny_dlna::DLNADeviceInfo::setDeviceType ( const char *  st)
inline

◆ setFriendlyName()

void tiny_dlna::DLNADeviceInfo::setFriendlyName ( const char *  name)
inline

◆ setIPAddress()

void tiny_dlna::DLNADeviceInfo::setIPAddress ( IPAddress  address)
inline

Defines the local IP address.

◆ setManufacturer()

void tiny_dlna::DLNADeviceInfo::setManufacturer ( const char *  man)
inline

◆ setManufacturerURL()

void tiny_dlna::DLNADeviceInfo::setManufacturerURL ( const char *  url)
inline

◆ setModelDescription()

void tiny_dlna::DLNADeviceInfo::setModelDescription ( const char *  descr)
inline

◆ setModelName()

void tiny_dlna::DLNADeviceInfo::setModelName ( const char *  name)
inline

◆ setModelNumber()

void tiny_dlna::DLNADeviceInfo::setModelNumber ( const char *  number)
inline

◆ setNS()

void tiny_dlna::DLNADeviceInfo::setNS ( const char *  ns)
inline

◆ setSerialNumber()

void tiny_dlna::DLNADeviceInfo::setSerialNumber ( const char *  sn)
inline

◆ setSubscriptionActive()

void tiny_dlna::DLNADeviceInfo::setSubscriptionActive ( bool  flag)
inline

◆ setUDN()

void tiny_dlna::DLNADeviceInfo::setUDN ( const char *  id)
inline

Define the udn uuid.

◆ setUniversalProductCode()

void tiny_dlna::DLNADeviceInfo::setUniversalProductCode ( const char *  upc)
inline

◆ setupServices()

virtual void tiny_dlna::DLNADeviceInfo::setupServices ( IHttpServer server,
IUDPService udp 
)
inlineprotectedvirtual

to be implemented by subclasses

Friends And Related Function Documentation

◆ DLNAControlPoint

friend class DLNAControlPoint
friend

◆ DLNADevice

template<typename >
friend class DLNADevice
friend

◆ XMLDeviceParser

friend class XMLDeviceParser
friend

Member Data Documentation

◆ base_url

Str tiny_dlna::DLNADeviceInfo::base_url = "http://localhost:9876/dlna"
protected

◆ device_type

Str tiny_dlna::DLNADeviceInfo::device_type
protected

◆ device_url

Url tiny_dlna::DLNADeviceInfo::device_url
protected

◆ friendly_name

Str tiny_dlna::DLNADeviceInfo::friendly_name
protected

◆ icon

Icon tiny_dlna::DLNADeviceInfo::icon
protected

◆ icons

Vector<Icon> tiny_dlna::DLNADeviceInfo::icons
protected

◆ is_active

bool tiny_dlna::DLNADeviceInfo::is_active = false
protected

◆ is_subcription_active

bool tiny_dlna::DLNADeviceInfo::is_subcription_active = false
protected

◆ localhost

IPAddress tiny_dlna::DLNADeviceInfo::localhost
protected

◆ manufacturer

Str tiny_dlna::DLNADeviceInfo::manufacturer
protected

◆ manufacturer_url

Str tiny_dlna::DLNADeviceInfo::manufacturer_url
protected

◆ model_description

Str tiny_dlna::DLNADeviceInfo::model_description
protected

◆ model_name

Str tiny_dlna::DLNADeviceInfo::model_name
protected

◆ model_number

Str tiny_dlna::DLNADeviceInfo::model_number
protected

◆ model_url

Str tiny_dlna::DLNADeviceInfo::model_url
protected

◆ ns

Str tiny_dlna::DLNADeviceInfo::ns = "xmlns=\"urn:schemas-upnp-org:device-1-0\""
protected

◆ serial_number

Str tiny_dlna::DLNADeviceInfo::serial_number
protected

◆ services

Vector<DLNAServiceInfo> tiny_dlna::DLNADeviceInfo::services
protected

◆ udn

Str tiny_dlna::DLNADeviceInfo::udn = "uuid:09349455-2941-4cf7-9847-0dd5ab210e97"
protected

◆ universal_product_code

Str tiny_dlna::DLNADeviceInfo::universal_product_code
protected

◆ url_str

Str tiny_dlna::DLNADeviceInfo::url_str
protected

◆ version_major

int tiny_dlna::DLNADeviceInfo::version_major = 1
protected

◆ version_minor

int tiny_dlna::DLNADeviceInfo::version_minor = 0
protected

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