Exemplo n.º 1
0
func (t *DeviceRestGetHandler) Get(context HttpContext) {
	q := system.CommandQueue().GetQueue()

	sysDevId := strings.SplitN(context.GetContextParams()[0], ":", 2)
	state := context.GetContextParams()[1]
	c := system.NewRcswitchCommand(sysDevId[0], sysDevId[1], state, new(DeviceCallback))
	q <- c

	for i := 0; i < len(context.GetContextParams()); i++ {
		log.Print("ContextParam ", context.GetContextParams()[i])
	}
}
Exemplo n.º 2
0
func init() {
	system.CommandQueue().Start()
}