Arduino DLNA Server
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
tiny_dlna::DLNADevice 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 mimimize the RAM useage. If you need to keep the values on the heap you can use addString() method. More...

#include <DLNADevice.h>

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

Public Member Functions

 DLNADevice (bool ok=true)
 
void print (Print &out)
 renderes the device xml More...
 
void setDeviceType (const char *st)
 
const char * getDeviceType ()
 
void setUDN (const char *id)
 Define the udn uuid. More...
 
const char * getUDN ()
 Provide the udn uuid. More...
 
void setBaseURL (Url url)
 Defines the base url. More...
 
UrlgetBaseURL ()
 Provides the base url. More...
 
UrlgetDeviceURL ()
 This method returns base url/device.xml. More...
 
void setIPAddress (IPAddress address)
 
IPAddress getIPAddress ()
 
const char * getIPStr ()
 Provides the local address as string. More...
 
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 setUniveralProductCode (const char *upc)
 
const char * getUniveralProductCode ()
 
void addService (DLNAServiceInfo s)
 Adds a service defintion. More...
 
DLNAServiceInfogetService (const char *id)
 Finds a service definition by name. More...
 
Vector< DLNAServiceInfo > & getServices ()
 
void clear ()
 
void clearIcons ()
 Overwrite the default icon. More...
 
void addIcon (Icon icon)
 
Icon getIcon (int idx=0)
 
 operator bool ()
 
const char * addString (char *string)
 Adds a string to the string repository. More...
 
void updateTimestamp ()
 Update the timestamp. More...
 
uint32_t getTimestamp ()
 Returns the time when this object has been updated. More...
 
void setActive (bool flag)
 
StringRegistrygetStringRegistry ()
 

Protected Member Functions

size_t printRoot ()
 
size_t printDevice ()
 
size_t printSpecVersion ()
 
size_t printServiceList ()
 
size_t printService (void *srv)
 
size_t printIconList ()
 
size_t printIconDlnaInfo (Icon &icon)
 

Protected Attributes

uint64_t timestamp = 0
 
bool is_active = true
 
XMLPrinter xml
 
Url base_url {"http://localhost:9876/dlna"}
 
Url device_url
 
IPAddress localhost
 
int version_major = 1
 
int version_minor = 0
 
const char * udn = "uuid:09349455-2941-4cf7-9847-0dd5ab210e97"
 
const char * ns = "xmlns=\"urn:schemas-upnp-org:device-1-0\""
 
const char * device_type = nullptr
 
const char * friendly_name = nullptr
 
const char * manufacturer = nullptr
 
const char * manufacturer_url = nullptr
 
const char * model_description = nullptr
 
const char * model_name = nullptr
 
const char * model_url = nullptr
 
const char * model_number = nullptr
 
const char * serial_number = nullptr
 
const char * universal_product_code = nullptr
 
Icon icon
 
Vector< DLNAServiceInfoservices
 
Vector< Iconicons
 
StringRegistry strings
 

Friends

class XMLDeviceParser
 
class DLNAControlPointMgr
 

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 mimimize the RAM useage. If you need to keep the values on the heap you can use addString() method.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ DLNADevice()

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

Member Function Documentation

◆ addIcon()

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

◆ addService()

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

Adds a service defintion.

◆ addString()

const char* tiny_dlna::DLNADevice::addString ( char *  string)
inline

Adds a string to the string repository.

◆ clear()

void tiny_dlna::DLNADevice::clear ( )
inline

◆ clearIcons()

void tiny_dlna::DLNADevice::clearIcons ( )
inline

Overwrite the default icon.

◆ getBaseURL()

Url& tiny_dlna::DLNADevice::getBaseURL ( )
inline

Provides the base url.

◆ getDeviceType()

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

◆ getDeviceURL()

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

This method returns base url/device.xml.

◆ getFriendlyName()

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

◆ getIcon()

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

◆ getIPAddress()

IPAddress tiny_dlna::DLNADevice::getIPAddress ( )
inline

◆ getIPStr()

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

Provides the local address as string.

◆ getManufacturer()

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

◆ getManufacturerURL()

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

◆ getModelDescription()

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

◆ getModelName()

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

◆ getModelNumber()

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

◆ getNS()

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

◆ getSerialNumber()

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

◆ getService()

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

Finds a service definition by name.

◆ getServices()

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

◆ getStringRegistry()

StringRegistry& tiny_dlna::DLNADevice::getStringRegistry ( )
inline

◆ getTimestamp()

uint32_t tiny_dlna::DLNADevice::getTimestamp ( )
inline

Returns the time when this object has been updated.

◆ getUDN()

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

Provide the udn uuid.

◆ getUniveralProductCode()

const char* tiny_dlna::DLNADevice::getUniveralProductCode ( )
inline

◆ operator bool()

tiny_dlna::DLNADevice::operator bool ( )
inline

◆ print()

void tiny_dlna::DLNADevice::print ( Print &  out)
inline

renderes the device xml

◆ printDevice()

size_t tiny_dlna::DLNADevice::printDevice ( )
inlineprotected

◆ printIconDlnaInfo()

size_t tiny_dlna::DLNADevice::printIconDlnaInfo ( Icon icon)
inlineprotected

◆ printIconList()

size_t tiny_dlna::DLNADevice::printIconList ( )
inlineprotected

◆ printRoot()

size_t tiny_dlna::DLNADevice::printRoot ( )
inlineprotected

◆ printService()

size_t tiny_dlna::DLNADevice::printService ( void *  srv)
inlineprotected

◆ printServiceList()

size_t tiny_dlna::DLNADevice::printServiceList ( )
inlineprotected

◆ printSpecVersion()

size_t tiny_dlna::DLNADevice::printSpecVersion ( )
inlineprotected

◆ setActive()

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

◆ setBaseURL()

void tiny_dlna::DLNADevice::setBaseURL ( Url  url)
inline

Defines the base url.

◆ setDeviceType()

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

◆ setFriendlyName()

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

◆ setIPAddress()

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

◆ setManufacturer()

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

◆ setManufacturerURL()

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

◆ setModelDescription()

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

◆ setModelName()

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

◆ setModelNumber()

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

◆ setNS()

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

◆ setSerialNumber()

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

◆ setUDN()

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

Define the udn uuid.

◆ setUniveralProductCode()

void tiny_dlna::DLNADevice::setUniveralProductCode ( const char *  upc)
inline

◆ updateTimestamp()

void tiny_dlna::DLNADevice::updateTimestamp ( )
inline

Update the timestamp.

Friends And Related Function Documentation

◆ DLNAControlPointMgr

friend class DLNAControlPointMgr
friend

◆ XMLDeviceParser

friend class XMLDeviceParser
friend

Member Data Documentation

◆ base_url

Url tiny_dlna::DLNADevice::base_url {"http://localhost:9876/dlna"}
protected

◆ device_type

const char* tiny_dlna::DLNADevice::device_type = nullptr
protected

◆ device_url

Url tiny_dlna::DLNADevice::device_url
protected

◆ friendly_name

const char* tiny_dlna::DLNADevice::friendly_name = nullptr
protected

◆ icon

Icon tiny_dlna::DLNADevice::icon
protected

◆ icons

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

◆ is_active

bool tiny_dlna::DLNADevice::is_active = true
protected

◆ localhost

IPAddress tiny_dlna::DLNADevice::localhost
protected

◆ manufacturer

const char* tiny_dlna::DLNADevice::manufacturer = nullptr
protected

◆ manufacturer_url

const char* tiny_dlna::DLNADevice::manufacturer_url = nullptr
protected

◆ model_description

const char* tiny_dlna::DLNADevice::model_description = nullptr
protected

◆ model_name

const char* tiny_dlna::DLNADevice::model_name = nullptr
protected

◆ model_number

const char* tiny_dlna::DLNADevice::model_number = nullptr
protected

◆ model_url

const char* tiny_dlna::DLNADevice::model_url = nullptr
protected

◆ ns

const char* tiny_dlna::DLNADevice::ns = "xmlns=\"urn:schemas-upnp-org:device-1-0\""
protected

◆ serial_number

const char* tiny_dlna::DLNADevice::serial_number = nullptr
protected

◆ services

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

◆ strings

StringRegistry tiny_dlna::DLNADevice::strings
protected

◆ timestamp

uint64_t tiny_dlna::DLNADevice::timestamp = 0
protected

◆ udn

const char* tiny_dlna::DLNADevice::udn = "uuid:09349455-2941-4cf7-9847-0dd5ab210e97"
protected

◆ universal_product_code

const char* tiny_dlna::DLNADevice::universal_product_code = nullptr
protected

◆ version_major

int tiny_dlna::DLNADevice::version_major = 1
protected

◆ version_minor

int tiny_dlna::DLNADevice::version_minor = 0
protected

◆ xml

XMLPrinter tiny_dlna::DLNADevice::xml
protected

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