MythTV master
upnpcmgr.h
Go to the documentation of this file.
1
2// Program Name: UPnpCMGR.h
3// Created : Dec. 28, 2006
4//
5// Purpose : uPnp Connection Manager Service
6//
7// Copyright (c) 2006 David Blain <dblain@mythtv.org>
8//
9// Licensed under the GPL v2 or later, see LICENSE for details
10//
12
13#ifndef UPnpCMGR_H_
14#define UPnpCMGR_H_
15
16#include "httpserver.h"
17#include "eventing.h"
18
19enum UPnpCMGRMethod : std::uint8_t
20{
27};
28
30
31enum UPnpCMGRConnectionStatus : std::uint8_t
32{
38};
39
42//
43// UPnpCMGR Class Definition
44//
47
49{
50 private:
51
54
56
57 static UPnpCMGRMethod GetMethod ( const QString &sURI );
58
59 void HandleGetProtocolInfo ( HTTPRequest *pRequest );
60 static void HandleGetCurrentConnectionInfo( HTTPRequest *pRequest );
61 void HandleGetCurrentConnectionIDs ( HTTPRequest *pRequest );
62 void HandleGetFeatureList ( HTTPRequest *pRequest );
63
64 protected:
65
66 // Implement UPnpServiceImpl methods that we can
67
68 QString GetServiceType() override // UPnpServiceImpl
69 { return "urn:schemas-upnp-org:service:ConnectionManager:3"; }
70 QString GetServiceId() override // UPnpServiceImpl
71 { return "urn:upnp-org:serviceId:ConnectionManager"; }
72 QString GetServiceControlURL() override // UPnpServiceImpl
73 { return m_sControlUrl.mid( 1 ); }
74 QString GetServiceDescURL() override // UPnpServiceImpl
75 { return m_sControlUrl.mid( 1 ) + "/GetServDesc"; }
76
77 public:
78 UPnpCMGR( UPnpDevice *pDevice,
79 const QString &sSharePath,
80 const QString &sSourceProtocols = "",
81 const QString &sSinkProtocols = "" );
82
83 ~UPnpCMGR() override = default;
84
85 void AddSourceProtocol( const QString &sProtocol );
86 void AddSinkProtocol ( const QString &sProtocol );
87
88 QStringList GetBasePaths() override; // Eventing
89
90 bool ProcessRequest( HTTPRequest *pRequest ) override; // Eventing
91};
92
93#endif
bool ProcessRequest(HTTPRequest *pRequest) override
Definition: eventing.cpp:147
QStringList GetBasePaths() override
Definition: eventing.cpp:135
QString m_sServiceDescFileName
Definition: upnpcmgr.h:52
QString m_sControlUrl
Definition: upnpcmgr.h:53
QString GetServiceType() override
Provices the schema urn.
Definition: upnpcmgr.h:68
QString GetServiceId() override
Provides the device specific urn.
Definition: upnpcmgr.h:70
~UPnpCMGR() override=default
UPnPFeatureList m_features
Definition: upnpcmgr.h:55
QString GetServiceDescURL() override
Provices the URL of the service description XML.
Definition: upnpcmgr.h:74
QString GetServiceControlURL() override
Provices the base URL for control commands.
Definition: upnpcmgr.h:72
UPnpCMGRConnectionStatus
Definition: upnpcmgr.h:32
@ CMGRSTATUS_Unknown
Definition: upnpcmgr.h:33
@ CMGRSTATUS_OK
Definition: upnpcmgr.h:34
@ CMGRSTATUS_UnreliableChannel
Definition: upnpcmgr.h:37
@ CMGRSTATUS_ContentFormatMismatch
Definition: upnpcmgr.h:35
@ CMGRSTATUS_InsufficientBandwidth
Definition: upnpcmgr.h:36
UPnpCMGRMethod
Definition: upnpcmgr.h:20
@ CMGRM_GetServiceDescription
Definition: upnpcmgr.h:22
@ CMGRM_GetFeatureList
Definition: upnpcmgr.h:26
@ CMGRM_GetCurrentConnectionIDs
Definition: upnpcmgr.h:25
@ CMGRM_GetProtocolInfo
Definition: upnpcmgr.h:23
@ CMGRM_GetCurrentConnectionInfo
Definition: upnpcmgr.h:24
@ CMGRM_Unknown
Definition: upnpcmgr.h:21
#define UPNP_PUBLIC
Definition: upnpexp.h:9