Skip to content
Snippets Groups Projects
Commit c575c5e1 authored by jkerdreu's avatar jkerdreu
Browse files

- Swicth to internal uuid

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Go/trunk/xaal-lib/apps@3239 b32b6428-25c9-4566-ad07-03861ab6144f
parent a75cfaa1
No related branches found
No related tags found
No related merge requests found
......@@ -5,9 +5,8 @@ package main
import (
"time"
"xAAL/uuid"
"xAAL/xaal"
"github.com/google/uuid"
)
type Lamp struct {
......@@ -92,12 +91,11 @@ func main() {
eng := xaal.NewEngine()
eng.Start()
baseAddr := uuid.MustParse("89b11138-a76b-11ee-91c7-d6bd5fe18700")
baseAddr, _ := uuid.FromString("89b11138-a76b-11ee-91c7-d6bd5fe10000")
group := baseAddr
group[15] = 0xff
for i := 0; i < 6; i++ {
baseAddr[15] = byte(i)
l := newLamp(baseAddr, group)
for i := int64(0); i < 6; i++ {
addr, _ := baseAddr.Add(i)
l := newLamp(addr, group)
eng.AddDevice(l.dev)
// if i == 0 {
// go l.blink(nil)
......
package main
import (
xaal "xAAL/xaal"
"github.com/google/uuid"
"xAAL/uuid"
"xAAL/xaal"
)
func main() {
......@@ -12,7 +11,7 @@ func main() {
eng.Start()
lamp := xaal.NewDevice("lamp.dimmer")
lamp.Address = uuid.MustParse("6558b72b-3ae6-4995-8c4c-e407b7119889")
lamp.Address, _ = uuid.FromString("6558b72b-3ae6-4995-8c4c-e407b7119889")
light := lamp.AddAttribute("light", true)
brightness := lamp.AddAttribute("brightness", 50)
......
package main
import (
xaal "xAAL/xaal"
"xAAL/uuid"
"xAAL/xaal"
schemas "xAAL/xaalschemas"
"github.com/google/uuid"
)
func main() {
......@@ -12,9 +11,9 @@ func main() {
eng := xaal.NewEngine()
eng.Start()
grpID, _ := uuid.NewRandom()
grpID := uuid.Random()
addr := uuid.MustParse("820f3c5c-029a-4799-8105-8d6d5357462a")
addr, _ := uuid.FromString("820f3c5c-029a-4799-8105-8d6d5357462b")
lamp := schemas.NewLampDimmer(addr)
lamp.Info = "Fake (Go)lamp from schemas"
lamp.HWID = "0x1234"
......@@ -44,7 +43,7 @@ func main() {
lamp.SetMethod("turn_on", turnOn)
lamp.SetMethod("turn_off", turnOff)
addr = uuid.MustParse("820f3c5c-029a-4799-8105-8d6d5357462c")
addr, _ = addr.Add(1)
btn := schemas.NewButton(addr)
btn.Info = "Fake button from schemas"
btn.GroupID = grpID
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment