UPnP::ServiceControl Class Reference

#include <ServiceControl.h>

Inheritance diagram for UPnP::ServiceControl:
Collaboration diagram for UPnP::ServiceControl:

Classes

struct  Description
 

Public Types

using List = ObjectList< ServiceControl >
 
using OwnedList = OwnedObjectList< ServiceControl >
 
using Field = Service::Field
 
- Public Types inherited from UPnP::Service
enum class  Field { XX , customStart = domain , MAX }
 
using List = ObjectList< Service >
 
using OwnedList = OwnedObjectList< Service >
 
- Public Types inherited from UPnP::Object
using Version = ObjectClass::Version
 

Public Member Functions

 ServiceControl ()=delete
 
 ServiceControl (const ServiceControl &)=delete
 
 ServiceControl (DeviceControl &device)
 
DeviceControlroot ()
 Get the root device. More...
 
const DeviceControlroot () const
 
String getField (Field desc) const override
 
ServiceControlgetNext () const
 
bool sendRequest (HttpRequest *request) const override
 Implemented in ServiceControl. More...
 
Error handleAction (ActionRequest &req) override
 An action request has been received. More...
 
bool configure (const XML::Node *service)
 Called during initialisation to configure this object. More...
 
DeviceControldevice () const
 
const Descriptiondescription ()
 Get service description. More...
 
- Public Member Functions inherited from UPnP::Service
 Service (Device &device)
 
Deviceroot ()
 
String caption () const
 
void search (const SearchFilter &filter) override
 Called during SSDP search operation. More...
 
bool formatMessage (Message &msg, MessageSpec &ms) override
 Standard fields have been completed. More...
 
bool onHttpRequest (HttpServerConnection &connection) override
 Called by framework to handle an incoming HTTP request. More...
 
Urn objectType () const override
 
String serviceId () const
 
XML::NodegetDescription (XML::Document &doc, DescType descType) const override
 
IDataSourceStreamcreateDescription () override
 Called by framework to construct a device description response stream. More...
 
Devicedevice () const
 
- Public Member Functions inherited from UPnP::ObjectTemplate< Service, Object >
ServicegetNext () const
 
Iterator begin () const
 
Iterator end () const
 
- Public Member Functions inherited from UPnP::Object
virtual const ObjectClassgetClass () const =0
 
ObjectgetNext () const
 
bool typeIs (const Urn &objectType) const
 
bool typeIs (const String &objectType) const
 
bool typeIs (const ObjectClass &objectClass) const
 
virtual Version version () const
 
- Public Member Functions inherited from UPnP::BaseObject
virtual void sendMessage (Message &msg, MessageSpec &ms)
 Called by framework to construct then send a message. More...
 
- Public Member Functions inherited from UPnP::LinkedItem
Itemnext () const override
 
LinkedItemgetNext () const
 
- Public Member Functions inherited from UPnP::Item
virtual ~Item ()
 
virtual ItemEnumeratorgetList (unsigned index, String &name)
 
bool operator== (const Item &other) const
 

Member Typedef Documentation

◆ Field

◆ List

◆ OwnedList

Constructor & Destructor Documentation

◆ ServiceControl() [1/3]

UPnP::ServiceControl::ServiceControl ( )
delete

◆ ServiceControl() [2/3]

UPnP::ServiceControl::ServiceControl ( const ServiceControl )
delete

◆ ServiceControl() [3/3]

UPnP::ServiceControl::ServiceControl ( DeviceControl device)
inline

Member Function Documentation

◆ configure()

bool UPnP::ServiceControl::configure ( const XML::Node service)

Called during initialisation to configure this object.

◆ description()

const Description& UPnP::ServiceControl::description ( )
inline

Get service description.

◆ device()

DeviceControl& UPnP::ServiceControl::device ( ) const
inline

◆ getField()

String UPnP::ServiceControl::getField ( Field  desc) const
overridevirtual

Reimplemented from UPnP::Service.

◆ getNext()

ServiceControl* UPnP::ServiceControl::getNext ( ) const
inline

◆ handleAction()

Error UPnP::ServiceControl::handleAction ( ActionRequest req)
inlineoverridevirtual

An action request has been received.

Parameters
envContains the action request
Return values
ErrorCodeImplementation should place response into env after reading parameters, e.g.:
if(env.actionName() == "MyAction") {
        String arg1;
        int arg2;
        env.getArg("arg1", arg1);
        env.getArg("arg2", arg2);
        auto& response = env.createResponse();
        // Process command here
        int arg3 = processMyAction(arg1, arg2);
        response.setArg("arg3", arg3);
        return ErrorCode::Success;
    }

    return ErrorCode::InvalidAction;
This is usually handled by generated wrapper class templates.

Implements UPnP::Service.

◆ root() [1/2]

DeviceControl& UPnP::ServiceControl::root ( )
inline

Get the root device.

◆ root() [2/2]

const DeviceControl& UPnP::ServiceControl::root ( ) const
inline

◆ sendRequest()

bool UPnP::ServiceControl::sendRequest ( HttpRequest request) const
overridevirtual

Implemented in ServiceControl.

Reimplemented from UPnP::Service.


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