Broken I2C but working server side and reactor config

main
KeeganForelight 2 years ago
parent 1ea93a786c
commit 204ba6fb82

BIN
debian

Binary file not shown.

@ -19,6 +19,7 @@ func NewManager(max int) Manager {
type ControllerManager struct {
Manager
Name string
*pb.Device
@ -31,6 +32,10 @@ func NewControllerManager(device *pb.Device) *ControllerManager {
return &ControllerManager{Manager: m, Device: device}
}
func (c *ControllerManager) GetName() string {
return c.Name
}
func (c *ControllerManager) GetDevice() *pb.Device {
return c.Device
}

@ -49,6 +49,7 @@ func (c *DeviceCoordinator) UpdateDevices(config *viper.Viper, i2c I2CClient, ac
return err
}
// loading config
c.Managers[addr].LoadConfig("reactor")
// check for config name
// nameKey := fmt.Sprintf("device.%d.name", addr)

@ -173,7 +173,7 @@ func (c *ReactorCoordinator) Monitor() {
if err != nil {
c.Err <- err
}
go c.UpdateDevices(c.Config, c.I2C, active)
go c.DeviceCoordinator.UpdateDevices(c.Config, c.I2C, active)
go c.Ping()
}
}

@ -111,7 +111,6 @@ func (r *ReactorManager) UpdateDevices(devs []*pb.Device) {
} else {
// not found
go r.AddDevice(dev, r.Id, r.Config, r.Err)
fmt.Printf("ID %d\n", r.Id)
}
}
}

Loading…
Cancel
Save