Пример #1
0
func handleEvent_TestEventBrief(reactor upnp.Reactor, c chan bool) {
	for {
		select {
		case evt := <-reactor.Channel():
			switch evt.Type() {
			case upnp.AlarmClock_EventType:
				log.Printf("ALARM_CLOCK")
			case upnp.AVTransport_EventType:
				log.Printf("AV_TRANSPORT")
			case upnp.ConnectionManager_EventType:
				log.Printf("CONNECTION_MANAGER")
			case upnp.ContentDirectory_EventType:
				log.Printf("CONTENT_DIRECTORY")
			case upnp.DeviceProperties_EventType:
				log.Printf("DEVICE_PROPERTIES")
			case upnp.GroupManagement_EventType:
				log.Printf("GROUP_MANAGEMENT")
			case upnp.MusicServices_EventType:
				log.Printf("MUSIC_SERVICES")
			case upnp.RenderingControl_EventType:
				log.Printf("RENDERING_CONTROL")
			case upnp.SystemProperties_EventType:
				log.Printf("SYSTEM_PROPERTIES")
			case upnp.ZoneGroupTopology_EventType:
				log.Printf("ZONE_GROUP_TOPOLOGY")
			}
		}
	}
	c <- true
}
Пример #2
0
func handleEvent_TestEvent(reactor upnp.Reactor, c chan bool) {
	for {
		select {
		case evt := <-reactor.Channel():
			switch evt.Type() {
			case upnp.AlarmClock_EventType:
				b := evt.(upnp.AlarmClockEvent)
				log.Printf("%#v", b)
			case upnp.AVTransport_EventType:
				b := evt.(upnp.AVTransportEvent)
				log.Printf("%#v", b)
			case upnp.ConnectionManager_EventType:
				b := evt.(upnp.ConnectionManagerEvent)
				log.Printf("%#v", b)
			case upnp.ContentDirectory_EventType:
				b := evt.(upnp.ContentDirectoryEvent)
				log.Printf("%#v", b)
			case upnp.DeviceProperties_EventType:
				b := evt.(upnp.DevicePropertiesEvent)
				log.Printf("%#v", b)
			case upnp.GroupManagement_EventType:
				b := evt.(upnp.GroupManagementEvent)
				log.Printf("%#v", b)
			case upnp.MusicServices_EventType:
				b := evt.(upnp.MusicServicesEvent)
				log.Printf("%#v", b)
			case upnp.RenderingControl_EventType:
				b := evt.(upnp.RenderingControlEvent)
				log.Printf("%#v", b)
			case upnp.SystemProperties_EventType:
				b := evt.(upnp.SystemPropertiesEvent)
				log.Printf("%#v", b)
			case upnp.ZoneGroupTopology_EventType:
				b := evt.(upnp.ZoneGroupTopologyEvent)
				log.Printf("%#v", b)
			}
		}
	}
	c <- true
}