-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdeviceio.py
More file actions
170 lines (137 loc) · 5.86 KB
/
Copy pathdeviceio.py
File metadata and controls
170 lines (137 loc) · 5.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# onvif/services/deviceio.py
from ..operator import ONVIFOperator
from ..utils import ONVIFWSDL
class DeviceIO:
def __init__(self, xaddr=None, **kwargs):
# References:
# - ONVIF Release 2.1 (June 2011) Split from Core 2.0
# - DeviceIOBinding (ver10/deviceio.wsdl)
# - Operations: https://developer.onvif.org/pub/specs/branches/development/wsdl/ver10/deviceio.wsdl
definition = ONVIFWSDL.get_definition("deviceio")
self.operator = ONVIFOperator(
definition["path"],
binding=f"{{{definition['namespace']}}}{definition['binding']}",
service_path="DeviceIO", # fallback
xaddr=xaddr,
**kwargs,
)
def GetServiceCapabilities(self):
return self.operator.call("GetServiceCapabilities")
def GetRelayOutputOptions(self, RelayOutputToken=None):
return self.operator.call(
"GetRelayOutputOptions", RelayOutputToken=RelayOutputToken
)
def GetAudioSources(self):
return self.operator.call("GetAudioSources")
def GetAudioOutputs(self):
return self.operator.call("GetAudioOutputs")
def GetVideoSources(self):
return self.operator.call("GetVideoSources")
def GetVideoOutputs(self):
return self.operator.call("GetVideoOutputs")
def GetVideoSourceConfiguration(self, VideoSourceToken):
return self.operator.call(
"GetVideoSourceConfiguration", VideoSourceToken=VideoSourceToken
)
def GetVideoOutputConfiguration(self, VideoOutputToken):
return self.operator.call(
"GetVideoOutputConfiguration", VideoOutputToken=VideoOutputToken
)
def GetAudioSourceConfiguration(self, AudioSourceToken):
return self.operator.call(
"GetAudioSourceConfiguration", AudioSourceToken=AudioSourceToken
)
def GetAudioOutputConfiguration(self, AudioOutputToken):
return self.operator.call(
"GetAudioOutputConfiguration", AudioOutputToken=AudioOutputToken
)
def SetVideoSourceConfiguration(self, Configuration, ForcePersistence):
return self.operator.call(
"SetVideoSourceConfiguration",
Configuration=Configuration,
ForcePersistence=ForcePersistence,
)
def SetVideoOutputConfiguration(self, Configuration, ForcePersistence):
return self.operator.call(
"SetVideoOutputConfiguration",
Configuration=Configuration,
ForcePersistence=ForcePersistence,
)
def SetAudioSourceConfiguration(self, Configuration, ForcePersistence):
return self.operator.call(
"SetAudioSourceConfiguration",
Configuration=Configuration,
ForcePersistence=ForcePersistence,
)
def SetAudioOutputConfiguration(self, Configuration, ForcePersistence):
return self.operator.call(
"SetAudioOutputConfiguration",
Configuration=Configuration,
ForcePersistence=ForcePersistence,
)
def GetVideoSourceConfigurationOptions(self, VideoSourceToken):
return self.operator.call(
"GetVideoSourceConfigurationOptions", VideoSourceToken=VideoSourceToken
)
def GetVideoOutputConfigurationOptions(self, VideoOutputToken):
return self.operator.call(
"GetVideoOutputConfigurationOptions", VideoOutputToken=VideoOutputToken
)
def GetAudioSourceConfigurationOptions(self, AudioSourceToken):
return self.operator.call(
"GetAudioSourceConfigurationOptions", AudioSourceToken=AudioSourceToken
)
def GetAudioOutputConfigurationOptions(self, AudioOutputToken):
return self.operator.call(
"GetAudioOutputConfigurationOptions", AudioOutputToken=AudioOutputToken
)
def GetRelayOutputs(self):
return self.operator.call("GetRelayOutputs")
def SetRelayOutputSettings(self, RelayOutput, RelayOutputToken, Properties):
return self.operator.call(
"SetRelayOutputSettings",
RelayOutput=RelayOutput,
RelayOutputToken=RelayOutputToken,
Properties=Properties,
)
def SetRelayOutputState(self, RelayOutputToken, LogicalState):
return self.operator.call(
"SetRelayOutputState",
RelayOutputToken=RelayOutputToken,
LogicalState=LogicalState,
)
def GetDigitalInputs(self):
return self.operator.call("GetDigitalInputs")
def GetDigitalInputConfigurationOptions(self, Token=None):
return self.operator.call("GetDigitalInputConfigurationOptions", Token=Token)
def SetDigitalInputConfigurations(self, DigitalInputs):
return self.operator.call(
"SetDigitalInputConfigurations", DigitalInputs=DigitalInputs
)
def GetSerialPorts(self):
return self.operator.call("GetSerialPorts")
def GetSerialPortConfiguration(self, SerialPortToken):
return self.operator.call(
"GetSerialPortConfiguration", SerialPortToken=SerialPortToken
)
def SetSerialPortConfiguration(self, SerialPortConfiguration, ForcePersistence):
return self.operator.call(
"SetSerialPortConfiguration",
SerialPortConfiguration=SerialPortConfiguration,
ForcePersistence=ForcePersistence,
)
def GetSerialPortConfigurationOptions(self, SerialPortToken):
return self.operator.call(
"GetSerialPortConfigurationOptions", SerialPortToken=SerialPortToken
)
def SendReceiveSerialCommand(
self, Token=None, SerialData=None, TimeOut=None, DataLength=None, Delimiter=None
):
return self.operator.call(
"SendReceiveSerialCommand",
Token=Token,
SerialData=SerialData,
TimeOut=TimeOut,
DataLength=DataLength,
Delimiter=Delimiter,
)