BrisaUpnp::BrisaDevice Class Reference

UPnP device implementation. More...

#include <BrisaUpnp/BrisaDevice>

List of all members.

Public Types

enum  xmlTags {
  Major, Minor, UrlBase, DeviceType,
  FriendlyName, Manufacturer, ManufacturerUrl, ModelDescription,
  ModelName, ModelNumber, ModelUrl, SerialNumber,
  Udn, Upc, PresentationUrl, FileAddress,
  Location, Server, IpAddress, Port,
  Running
}

Public Slots

void respondMSearch (const QString &st, const QString &senderIp, quint16 senderPort)

Public Member Functions

 BrisaDevice (QObject *parent=0)
 BrisaDevice (const BrisaDevice &dev)
 BrisaDevice (const QString &deviceType, const QString &friendlyName="", const QString &manufacturer="", const QString &manufacturerURL="", const QString &modelDescription="", const QString &modelName="", const QString &modelNumber="", const QString &modelURL="", const QString &serialNumber="", const QString &UDN="", const QString &UPC="", const QString &presentationURL="", QObject *parent=0)
 ~BrisaDevice ()
BrisaDeviceoperator= (const BrisaDevice &dev)
void setAttribute (xmlTags key, const QString &value)
QString getAttribute (xmlTags key) const
void addIcon (const QString &mimetype="", const QString &width="", const QString &height="", const QString &depth="", const QString &url="")
void addService (const QString &serviceType="", const QString &serviceId="", const QString &SCPDURL="", const QString &controlURL="", const QString &eventSubURL="")
void addService (BrisaService *serv)
void addEmbeddedDevice (const QString &deviceType="", const QString &friendlyName="", const QString &manufacturer="", const QString &manufacturerURL="", const QString &modelDescription="", const QString &modelName="", const QString &modelNumber="", const QString &modelURL="", const QString &serialNumber="", const QString &UDN="", const QString &UPC="", const QString &presentationURL="")
void addEmbeddedDevice (BrisaDevice *newEmbeddedDevice)
QList< BrisaIcongetIconList () const
QList< BrisaService * > getServiceList () const
QList< BrisaDevice * > getEmbeddedDeviceList () const
BrisaServicegetServiceById (const QString &serviceId)
BrisaServicegetServiceByType (const QString &serviceType)
void clear ()
void doNotify ()
void doByeBye ()
void start ()
void stop ()

Detailed Description

UPnP device implementation.

BrisaDevice provides a easy and fast way to create UPnP devices. Simply create a new BrisaDevice and call start() to join the network and be visible to available control points.

To add a service to the device, just create a new BrisaService with the chosen actions and events and add it to the device by calling addService(). The service will be automatically added to the device and the appropriate webserver urls paths will be created.

Embedded devices are also supported by BrisaDevice. Create a new BrisaDevice and call addEmbeddedDevice(), the embedded device will be announced when the root device joins the network.

To stop the device and leave the network, simply call the stop() method, ssdp messages will also be sent for any embedded devices.

See also:
BrisaUpnp::BrisaService

Definition at line 62 of file brisadevice.h.


Member Enumeration Documentation

Enumerator:
Major 
Minor 
UrlBase 
DeviceType 
FriendlyName 
Manufacturer 
ManufacturerUrl 
ModelDescription 
ModelName 
ModelNumber 
ModelUrl 
SerialNumber 
Udn 
Upc 
PresentationUrl 
FileAddress 
Location 
Server 
IpAddress 
Port 
Running 

Definition at line 98 of file brisadevice.h.


Constructor & Destructor Documentation

BrisaDevice::BrisaDevice ( QObject *  parent = 0  ) 

Creates a BrisaDevice with the given parent QObject.

Definition at line 37 of file brisadevice.cpp.

BrisaDevice::BrisaDevice ( const BrisaDevice dev  ) 

Copy constructor.

Definition at line 89 of file brisadevice.cpp.

BrisaDevice::BrisaDevice ( const QString &  deviceType,
const QString &  friendlyName = "",
const QString &  manufacturer = "",
const QString &  manufacturerURL = "",
const QString &  modelDescription = "",
const QString &  modelName = "",
const QString &  modelNumber = "",
const QString &  modelURL = "",
const QString &  serialNumber = "",
const QString &  UDN = "",
const QString &  UPC = "",
const QString &  presentationURL = "",
QObject *  parent = 0 
)

Creates a BrisaDevice with the given device information.

Definition at line 50 of file brisadevice.cpp.

BrisaDevice::~BrisaDevice (  ) 

Destructor for BrisaDevice. Stops the device if running.

Definition at line 153 of file brisadevice.cpp.


Member Function Documentation

void BrisaDevice::addEmbeddedDevice ( BrisaDevice newEmbeddedDevice  ) 

Overloads addEmbeddedDevice() Create a new BrisaDevice and call this method to add it as a embedded device to a root device. We recommend using this method for better object orientation.

Definition at line 345 of file brisadevice.cpp.

void BrisaDevice::addEmbeddedDevice ( const QString &  deviceType = "",
const QString &  friendlyName = "",
const QString &  manufacturer = "",
const QString &  manufacturerURL = "",
const QString &  modelDescription = "",
const QString &  modelName = "",
const QString &  modelNumber = "",
const QString &  modelURL = "",
const QString &  serialNumber = "",
const QString &  UDN = "",
const QString &  UPC = "",
const QString &  presentationURL = "" 
)

Creates and adds a embedded device with the given information to the device.

Definition at line 333 of file brisadevice.cpp.

void BrisaDevice::addIcon ( const QString &  mimetype = "",
const QString &  width = "",
const QString &  height = "",
const QString &  depth = "",
const QString &  url = "" 
)

Call this method to add a icon to the device.

Definition at line 314 of file brisadevice.cpp.

void BrisaDevice::addService ( BrisaService serv  ) 

Overloads addService(). Create a BrisaService and add it to the device. We recommend using this method for better object orientation.

See also:
BrisaUpnp::BrisaService

Definition at line 328 of file brisadevice.cpp.

void BrisaDevice::addService ( const QString &  serviceType = "",
const QString &  serviceId = "",
const QString &  SCPDURL = "",
const QString &  controlURL = "",
const QString &  eventSubURL = "" 
)

Creates and adds a service to the device with the given information.

Definition at line 320 of file brisadevice.cpp.

void BrisaDevice::clear (  ) 

Clears the device information, including services, icons and embedded devices.

Definition at line 584 of file brisadevice.cpp.

void BrisaDevice::doByeBye (  ) 

Sends the ssdp:byebye messages for root device, embedded devices and services according to the UPnP 1.0 especification.

Definition at line 520 of file brisadevice.cpp.

void BrisaDevice::doNotify (  ) 

Sends the ssdp:alive messages for root device, embedded devices and services according to the UPnP 1.0 especification.

Definition at line 549 of file brisadevice.cpp.

QString BrisaDevice::getAttribute ( xmlTags  key  )  const

Attribute getter.

See also:
setAttribute()

Definition at line 242 of file brisadevice.cpp.

QList< BrisaDevice * > BrisaDevice::getEmbeddedDeviceList (  )  const

Returns the embedded device list.

See also:
getIconList() , getServiceList()

Definition at line 512 of file brisadevice.cpp.

QList< BrisaIcon > BrisaDevice::getIconList (  )  const

Returns the icon list.

See also:
getEmbeddedDeviceList() , getServiceList()

Definition at line 508 of file brisadevice.cpp.

BrisaService * BrisaDevice::getServiceById ( const QString &  serviceId  ) 

Getter for BrisaService in the service list.

Definition at line 349 of file brisadevice.cpp.

BrisaService * BrisaDevice::getServiceByType ( const QString &  serviceType  ) 

Getter for BrisaService in the service list.

Definition at line 359 of file brisadevice.cpp.

QList< BrisaService * > BrisaDevice::getServiceList (  )  const

Returns the service list.

See also:
getEmbeddedDeviceList() , getIconList()

Definition at line 516 of file brisadevice.cpp.

BrisaDevice & BrisaDevice::operator= ( const BrisaDevice dev  ) 

Assigns dev to this BrisaDevice and returns a copy.

Definition at line 122 of file brisadevice.cpp.

void BrisaDevice::respondMSearch ( const QString &  st,
const QString &  senderIp,
quint16  senderPort 
) [slot]

Connects to the msearchRequestReceived() signal comming from the ssdp module. It parses the search type and responds accordingly.

See also:
respondMSearchAll()

Definition at line 414 of file brisadevice.cpp.

void BrisaDevice::setAttribute ( xmlTags  key,
const QString &  value 
)

Attribute setter.

See also:
getAttribute()

Definition at line 172 of file brisadevice.cpp.

void BrisaDevice::start (  ) 

Call this method to join the network and start the device.

See also:
stop()

Definition at line 369 of file brisadevice.cpp.

void BrisaDevice::stop (  ) 

Stops the device and leaves the network.

See also:
start()

Definition at line 382 of file brisadevice.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 30 14:04:30 2010 for Brisa by  doxygen 1.6.3