BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
UPnP.h
1 #pragma once
2 
3 #include <list>
4 #include <string>
5 
6 #include <Poco/Net/SocketAddress.h>
7 #include <Poco/Timespan.h>
8 
9 #include "util/Loggable.h"
10 
11 // Documentation for UPnP protocol
12 // http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf
13 // Section 1 Discovery
14 #define UPNP_MULTICAST_IP "239.255.255.250"
15 #define UPNP_PORT 1900
16 
17 namespace BeeeOn {
18 
19 class UPnP : protected Loggable {
20 public:
21  UPnP(const Poco::Net::SocketAddress& address = Poco::Net::SocketAddress(UPNP_MULTICAST_IP, UPNP_PORT));
22  std::list<Poco::Net::SocketAddress> discover(const Poco::Timespan& timeout, const std::string& deviceType);
23 
24 private:
25  Poco::Net::SocketAddress m_multicastAddress;
26 };
27 
28 }
Definition: UPnP.h:19
Definition: Loggable.h:19