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 {
27 {
28 public:
30  {
31  }
32 };
33 
35 {
36 public:
37  using Callback = Delegate<void(ActionResponse response)>;
38 
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
Definition: Delegate.h:20
The String class.
Definition: WString.h:137
Definition: ActionRequest.h:35
bool send(const Callback &callback)
ActionRequestControl(const Service &service, const String &actionName)
Definition: ActionRequest.h:39
Definition: ActionRequest.h:27
ActionRequest(Envelope &envelope, Stream *stream)
Definition: ActionRequest.h:29
Definition: ActionResponse.h:42
Class to handle action requests and responses.
Definition: ActionResponse.h:36
Stream * stream
Definition: ActionResponse.h:122
String actionName() const
Definition: ActionResponse.h:103
Envelope & envelope
Definition: ActionResponse.h:121
Class to manage a SOAP envelope for service request/response.
Definition: Envelope.h:36
Envelope & createRequest(const String &actionName)
Initialise the envelope as a request.
Represents any kind of device, including a root device.
Definition: UPnP/src/include/Network/UPnP/Service.h:47
Definition: ActionRequest.h:25