Open dsully opened 7 years ago
With this code:
{ exit_chan := make(chan bool) reactor := sonos.MakeReactor(SONOS_IFNAME, SONOS_EVENTING_PORT) go handleSonosEvent(reactor, exit_chan) } func handleSonosEvent(reactor upnp.Reactor, c chan bool) { for { select { case evt := <-reactor.Channel(): switch evt.Type() { case upnp.AVTransport_EventType: log.Printf("Got Event!") } } } }
This exception is thrown:
panic: reflect.Value.Interface: cannot return value obtained from unexported field or method goroutine 5 [running]: panic(0x2958e0, 0xc420324b20) /usr/local/Cellar/go/1.7.3/libexec/src/runtime/panic.go:500 +0x1a1 reflect.valueInterface(0x2c1e00, 0xc42020cb90, 0x1d9, 0x1, 0x1, 0xc4203244e0) /usr/local/Cellar/go/1.7.3/libexec/src/reflect/value.go:918 +0x1be reflect.Value.Interface(0x2c1e00, 0xc42020cb90, 0x1d9, 0x1d9, 0x2c1e00) /usr/local/Cellar/go/1.7.3/libexec/src/reflect/value.go:907 +0x44 encoding/xml.(*Decoder).unmarshal(0xc4201f3a20, 0x2ffda0, 0xc42020cb90, 0x199, 0xc420356480, 0xc42020cb90, 0x199) /usr/local/Cellar/go/1.7.3/libexec/src/encoding/xml/read.go:412 +0x1f5e encoding/xml.(*Decoder).unmarshalPath(0xc4201f3a20, 0xc420236da0, 0x2c1d60, 0xc42020cb70, 0x199, 0x0, 0x0, 0x0, 0xc420356480, 0x1, ...) /usr/local/Cellar/go/1.7.3/libexec/src/encoding/xml/read.go:627 +0x6a9 encoding/xml.(*Decoder).unmarshal(0xc4201f3a20, 0x2c1d60, 0xc42020cb70, 0x199, 0xc420356380, 0x199, 0x2ca2eea3) /usr/local/Cellar/go/1.7.3/libexec/src/encoding/xml/read.go:479 +0x10aa encoding/xml.(*Decoder).DecodeElement(0xc4201f3a20, 0x286500, 0xc42020cb70, 0x0, 0xc420362a01, 0x7c0078) /usr/local/Cellar/go/1.7.3/libexec/src/encoding/xml/read.go:133 +0x10b encoding/xml.(*Decoder).Decode(0xc4201f3a20, 0x286500, 0xc42020cb70, 0xc420051d40, 0xc420322401) /usr/local/Cellar/go/1.7.3/libexec/src/encoding/xml/read.go:121 +0x48 encoding/xml.Unmarshal(0xc420362a00, 0x13bd, 0x1500, 0x286500, 0xc42020cb70, 0x1500, 0x0) /usr/local/Cellar/go/1.7.3/libexec/src/encoding/xml/read.go:115 +0x1c3 github.com/ianr0bkny/go-sonos/upnp.(*AVTransport).HandleProperty(0xc42020cb70, 0xc4201faa90, 0xc42034c000, 0x189c, 0xc420074a20, 0x7d801, 0x18) /Users/dsully/dev/sonos-go-tools/vendor/src/github.com/ianr0bkny/go-sonos/upnp/AVTransport.go:132 +0x1c9 github.com/ianr0bkny/go-sonos/upnp.(*upnpDefaultReactor).maybePostEvent(0xc420074900, 0xc420322390) /Users/dsully/dev/sonos-go-tools/vendor/src/github.com/ianr0bkny/go-sonos/upnp/event.go:203 +0xe6 github.com/ianr0bkny/go-sonos/upnp.(*upnpDefaultReactor).run(0xc420074900) /Users/dsully/dev/sonos-go-tools/vendor/src/github.com/ianr0bkny/go-sonos/upnp/event.go:218 +0x126 created by github.com/ianr0bkny/go-sonos/upnp.(*upnpDefaultReactor).Init /Users/dsully/dev/sonos-go-tools/vendor/src/github.com/ianr0bkny/go-sonos/upnp/event.go:151 +0x359
If I comment out:
xml.Unmarshal([]byte(doc.LastChange), &this.AVTransportState.LastChange)
upnp/AVTransport.go line 132, the code continues. I'm not familiar enough with golang to understand fully what's going on here.
With this code:
This exception is thrown:
If I comment out:
upnp/AVTransport.go line 132, the code continues. I'm not familiar enough with golang to understand fully what's going on here.