ActionRequest.h
Go to the documentation of this file.
1 /****
2  * ActionRequest.h
3  *
4  * Copyright 2020 mikee47 <mike@sillyhouse.net>
5  *
6  * This file is part of the Sming UPnP Library
7  *
8  * This library is free software: you can redistribute it and/or modify it under the terms of the
9  * GNU General Public License as published by the Free Software Foundation, version 3 or later.
10  *
11  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  * See the GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along with this library.
16  * If not, see <https://www.gnu.org/licenses/>.
17  *
18  ****/
19 
20 #pragma once
21 
22 #include "ActionResponse.h"
23 
24 namespace UPnP
25 {
26 class ActionRequest : public ActionResponse
27 {
28 public:
30  {
31  }
32 };
33 
35 {
36 public:
37  using Callback = Delegate<void(ActionResponse response)>;
38 
39  ActionRequestControl(const Service& service, const String& actionName)
40  : ActionResponse(envelope, nullptr), envelope(service)
41  {
42  envelope.createRequest(actionName);
43  }
44 
45  bool send(const Callback& callback);
46 
47 private:
48  Envelope envelope;
49 };
50 
51 } // namespace UPnP
Base Stream class.
Definition: Wiring/Stream.h:32
String actionName() const
Definition: ActionResponse.h:103
The String class.
Definition: WString.h:136
Definition: ActionRequest.h:43
Class to manage a SOAP envelope for service request/response.
Definition: Envelope.h:52
ActionResponse(const ActionResponse &response)
Definition: ActionResponse.h:76
Envelope & envelope
Definition: ActionResponse.h:121
ActionRequest(Envelope &envelope, Stream *stream)
Definition: ActionRequest.h:63
Represents any kind of device, including a root device.
Definition: UPnP/src/include/Network/UPnP/Service.h:46
ActionRequestControl(const Service &service, const String &actionName)
Definition: ActionRequest.h:56
bool send(const Callback &callback)
Stream * stream
Definition: ActionResponse.h:122
Definition: ActionRequest.h:24
Delegate< void(ActionResponse response)> Callback
Definition: ActionRequest.h:54
Class to handle action requests and responses.
Definition: ActionResponse.h:35
Definition: Delegate.h:20
Envelope & createRequest(const String &actionName)
Initialise the envelope as a request.
Definition: ActionRequest.h:51