Skip to content
Snippets Groups Projects
Commit 93b78360 authored by KERDREUX Jerome's avatar KERDREUX Jerome
Browse files

Use a fix BaseAddr right now.. usefull for debug/test

parent 00778e4a
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ func setupDevice(dev *xaal.Device, bDevice *BridgeDevice) {
func NewDevices(bDevice *BridgeDevice) {
// TODO: Handle errors
baseAddr, _ := uuid.RandomBase(8)
baseAddr := GetGW().baseAddr
ieeeAddr, _ := hexStringToInteger(bDevice.IeeeAddress)
baseAddr, _ = baseAddr.Add(int64(ieeeAddr))
......
package main
import "sync"
import (
"sync"
"gitlab.imt-atlantique.fr/xaal/code/go/core/uuid"
)
type gateway struct {
devices []*BridgeDevice
devices []*BridgeDevice
baseAddr uuid.UUID
}
var instance *gateway
......@@ -11,7 +16,8 @@ var once sync.Once
func GetGW() *gateway {
once.Do(func() {
instance = &gateway{}
baseAdrr, _ := uuid.FromString("64eacb5a-8181-11ef-0000-000000000000")
instance = &gateway{baseAddr: baseAdrr}
})
return instance
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment