DeviceHost.h
Go to the documentation of this file.
1 /****
2  * DeviceHost.h
3  *
4  * Copyright 2019 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 "Device.h"
23 
24 namespace UPnP
25 {
27 {
28 public:
32  bool begin();
33 
34  void end();
35 
36  bool isActive() const;
37 
38  bool registerDevice(Device* device);
39 
40  bool unRegisterDevice(Device* device);
41 
43 
48 
50  {
51  return devices_;
52  }
53 
54  void notify(Device* device, NotifySubtype subype);
55 
59  void onSearchRequest(const BasicMessage& request);
60 
61 private:
62  void search(SearchFilter& filter, Device* device);
63 
64  Device::List devices_;
65 };
66 
67 extern DeviceHost deviceHost;
68 
69 } // namespace UPnP
Definition: HttpServerConnection.h:34
Base class for read-only stream.
Definition: DataSourceStream.h:46
Handles incoming messages.
Definition: SSDP/src/include/Network/SSDP/Message.h:62
The String class.
Definition: WString.h:137
Definition: DeviceHost.h:27
void notify(Device *device, NotifySubtype subype)
bool onHttpRequest(HttpServerConnection &connection)
bool unRegisterDevice(Device *device)
void onSearchRequest(const BasicMessage &request)
Called via SSDP when incoming message received.
Device::List & devices()
Definition: DeviceHost.h:49
bool begin()
Applications must call this to initialise UPnP stack.
bool registerDevice(Device *device)
bool isActive() const
IDataSourceStream * generateDebugPage(const String &title)
Create an HTML page which applications may serve up to assist with debugging.
Represents any kind of device, including a root device.
Definition: Libraries/UPnP/src/include/Network/UPnP/Device.h:58
NotifySubtype
SSDP Notification subtype.
Definition: MessageSpec.h:40
Definition: ActionRequest.h:25
DeviceHost deviceHost
Definition: BaseObject.h:39