-
Notifications
You must be signed in to change notification settings - Fork 21
/
type34_management_device.go
90 lines (80 loc) · 1.96 KB
/
type34_management_device.go
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
/*
* File Name: type34_management_device.go
* Description:
* Author: Chapman Ou <[email protected]>
* Created: 2014-08-20
*/
package godmi
import (
"fmt"
)
type ManagementDeviceType byte
const (
ManagementDeviceTypeOther ManagementDeviceType = 1 + iota
ManagementDeviceTypeUnknown
ManagementDeviceTypeNationalSemiconductorLM75
ManagementDeviceTypeNationalSemiconductorLM78
ManagementDeviceTypeNationalSemiconductorLM79
ManagementDeviceTypeNationalSemiconductorLM80
ManagementDeviceTypeNationalSemiconductorLM81
ManagementDeviceTypeAnalogDevicesADM9240
ManagementDeviceTypeDallasSemiconductorDS1780
ManagementDeviceTypeMaxim1617
ManagementDeviceTypeGenesysGL518SM
ManagementDeviceTypeWinbondW83781D
ManagementDeviceTypeHoltekHT82H791
)
func (m ManagementDeviceType) String() string {
types := [...]string{
"Other",
"Unknown",
"National Semiconductor LM75",
"National Semiconductor LM78",
"National Semiconductor LM79",
"National Semiconductor LM80",
"National Semiconductor LM81",
"Analog Devices ADM9240",
"Dallas Semiconductor DS1780",
"Maxim 1617",
"Genesys GL518SM",
"Winbond W83781D",
"Holtek HT82H791",
}
return types[m-1]
}
type ManagementDeviceAddressType byte
const (
ManagementDeviceAddressTypeOther ManagementDeviceAddressType = 1 + iota
ManagementDeviceAddressTypeUnknown
ManagementDeviceAddressTypeIOPort
ManagementDeviceAddressTypeMemory
ManagementDeviceAddressTypeSMBus
)
func (m ManagementDeviceAddressType) String() string {
types := [...]string{
"Other",
"Unknown",
"I/O Port",
"Memory",
"SM Bus",
}
return types[m-1]
}
type ManagementDevice struct {
infoCommon
Description string
Type ManagementDeviceType
Address uint32
AddressType ManagementDeviceAddressType
}
func (m ManagementDevice) String() string {
return fmt.Sprintf("Management Device\n"+
"\tDescription: %s\n"+
"\tType: %s\n"+
"\tAddress: %d\n"+
"\tAddress Type: %s",
m.Description,
m.Type,
m.Address,
m.AddressType)
}