1
2
3
4
5
6
7
8
9
10
11
12 """ Connection Manager service implementation
13
14 Common usage is to just add a ConnectionManagerServer (or
15 ConnectionManagerRenderer) class instance to a device.
16 """
17
18 __all__ = ('ConnectionManagerServer', 'ConnectionManagerRenderer')
19
20 import os.path
21
22 from brisa.core import log
23 from brisa.upnp.services.xmls import xml_path
24 from brisa.upnp.device import Service
25
26
27 service_name = 'ConnectionManager'
28 service_type = 'urn:schemas-upnp-org:service:ConnectionManager:1'
29 server_scpd_xml_path = os.path.join(xml_path, 'connection-manager-scpd.xml')
30 renderer_scpd_xml_path = os.path.join(xml_path, 'render-connmgr-scpd.xml')
31
32
34
38
40 """Required: Returns the protocol-related info that this \
41 ConnectionManager supports in its current state
42 """
43 log.debug('Action on ConnectionManager: GetProtocolInfo()')
44 return {'Source': 'http-get:*:*:*',
45 'Sink': ''}
46
48 """Required: Returns a comma-separated list of ConnectionIDs of
49 currently ongoing Connections."""
50 log.debug('Action on ConnectionManager: GetCurrentConnectionIDs()')
51
52
53 return {'ConnectionIDs': '0'}
54
56 """Required: Returns associated information of the connection
57 referred to by the ConnectionID parameter."""
58
59 log.debug('Action on ConnectionManager: GetCurrentConnectionInfo()')
60
61 return {'RcsID': '-1',
62 'AVTransportID': '-1',
63 'ProtocolInfo': '',
64 'PeerConnectionManager': '',
65 'PeerConnectionID': '-1',
66 'Direction': 'Output',
67 'Status': 'OK'}
68
69
71
75
77 """Required: Returns the protocol-related info that this
78 ConnectionManager supports in its current state - Specific
79 for MediaRenderer Devices"""
80
81 log.debug('Action on ConnectionManager: GetProtocolInfo()')
82 return {'Source': '', 'Sink':
83 'http-get:*:audio/mpeg:*'}
84
86 """Required: Returns associated information of the connection
87 referred to by the ConnectionID parameter."""
88
89 log.debug('Action on ConnectionManager: GetCurrentConnectionInfo()')
90
91 return {'RcsID': '0',
92 'AVTransportID': '0',
93 'ProtocolInfo': '',
94 'PeerConnectionManager': '',
95 'PeerConnectionID': '-1',
96 'Direction': 'Input',
97 'Status': 'OK'}
98
100 """Required: Returns a comma-separated list of ConnectionIDs of
101 currently ongoing Connections."""
102
103 log.debug('Action on ConnectionManager: GetCurrentConnectionIDs()')
104
105
106 return {'ConnectionIDs': '0'}
107