Skip to content

Commit

Permalink
add vendor list
Browse files Browse the repository at this point in the history
  • Loading branch information
chbmuc committed Oct 24, 2014
1 parent 1865d6a commit d0c218d
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions cec.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,27 @@ import(
)

type Device struct {
OSDName string
Vendor string
LogicalAddress int
ActiveSource bool
PowerStatus string
VendorId uint64
PhysicalAddress string
OSDName string
}

var logicalNames = []string{"TV", "Recording", "Recording2", "Tuner", "Playback", "Audio", "Tuner2", "Tuner3", "Playback2", "Recording3", "Tuner4", "Playback3", "Reserved", "Reserved2", "Free", "Broadcast"}
var logicalNames = []string{ "TV", "Recording", "Recording2", "Tuner",
"Playback","Audio", "Tuner2", "Tuner3",
"Playback2", "Recording3", "Tuner4", "Playback3",
"Reserved", "Reserved2", "Free", "Broadcast" }

var vendorList = map[uint64]string{ 0x000039:"Toshiba", 0x0000F0:"Samsung",
0x0005CD:"Denon", 0x000678:"Marantz", 0x000982:"Loewe", 0x0009B0:"Onkyo",
0x000CB8:"Medion", 0x000CE7:"Toshiba", 0x001582:"Pulse Eight",
0x0020C7:"Akai", 0x002467:"Aoc", 0x008045:"Panasonic", 0x00903E:"Philips",
0x009053:"Daewoo", 0x00A0DE:"Yamaha", 0x00D0D5:"Grundig",
0x00E036:"Pioneer", 0x00E091:"LG", 0x08001F:"Sharp", 0x080046:"Sony",
0x18C086:"Broadcom", 0x6B746D:"Vizio", 0x8065E9:"Benq",
0x9C645E:"Harman Kardon" }

func Open(name string, deviceName string) {
var config CECConfiguration
Expand Down Expand Up @@ -67,7 +79,7 @@ func List() map[string]Device {
dev.OSDName = GetDeviceOSDName(address)
dev.PowerStatus = GetDevicePowerStatus(address)
dev.ActiveSource = IsActiveSource(address)
dev.VendorId = GetDeviceVendorId(address)
dev.Vendor = GetVendorById(GetDeviceVendorId(address))

devices[logicalNames[address]] = dev
}
Expand Down Expand Up @@ -111,3 +123,7 @@ func GetLogicalAddressByName(name string) int {
func GetLogicalNameByAddress(addr int) string {
return logicalNames[addr]
}

func GetVendorById(id uint64) string {
return vendorList[id]
}

0 comments on commit d0c218d

Please sign in to comment.