-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDenon_AVR-2310.ps1
59 lines (46 loc) · 1.29 KB
/
Denon_AVR-2310.ps1
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
class Denon_AVR_2310 {
hidden [System.IO.Ports.SerialPort]$Device = [System.IO.Ports.SerialPort]::New()
[string]$Port = 'COM1'
[int]$MonitorID = 1
[string]$SICPVersion
[string]$PlatformLabel
[string]$PlatformVersion
[String]$ModelNumber
[string]$FirmwareVersion
[string]$BuildDate
hidden [HashTable]$TranslationTable = @{
# put lookup tables here
}
[void] Connect () {
if ($This.Device) {$This.Device.close()}
try {
$This.Device.PortName = $This.Port
$This.Device.BaudRate = 9600
$This.Device.DataBits = 8
$This.Device.Parity = "None"
$This.Device.StopBits = 1
$This.Device.Handshake = "None"
$This.Device.ReadTimeout = 1000
$This.Device.WriteTimeout = 1000
$This.Device.open()
}
Catch {
$This.Device.close()
Continue
}
return
}
[void] Disconnect () {
$This.Device.close()
return
}
# Set Commands
# Get Commands
# For processing commands
hidden [PSCustomObject] Receive () {
return @{}
}
hidden [void] Send ([byte[]]$Message) {
return
}
}