UPnP device implementation. More...
#include <BrisaUpnp/BrisaDevice>
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 () | |
| BrisaDevice & | operator= (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< BrisaIcon > | getIconList () const |
| QList< BrisaService * > | getServiceList () const |
| QList< BrisaDevice * > | getEmbeddedDeviceList () const |
| BrisaService * | getServiceById (const QString &serviceId) |
| BrisaService * | getServiceByType (const QString &serviceType) |
| void | clear () |
| void | doNotify () |
| void | doByeBye () |
| void | start () |
| void | stop () |
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.
Definition at line 62 of file brisadevice.h.
Definition at line 98 of file brisadevice.h.
| 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.
| 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.
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 |
| QList< BrisaDevice * > BrisaDevice::getEmbeddedDeviceList | ( | ) | const |
Returns the embedded device list.
Definition at line 512 of file brisadevice.cpp.
| QList< BrisaIcon > BrisaDevice::getIconList | ( | ) | const |
Returns the icon list.
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.
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.
Definition at line 414 of file brisadevice.cpp.
| void BrisaDevice::setAttribute | ( | xmlTags | key, | |
| const QString & | value | |||
| ) |
| void BrisaDevice::start | ( | ) |
Call this method to join the network and start the device.
Definition at line 369 of file brisadevice.cpp.
| void BrisaDevice::stop | ( | ) |
Stops the device and leaves the network.
Definition at line 382 of file brisadevice.cpp.
1.6.3