Documentation ¶
Index ¶
- Constants
- Variables
- func MilliAmpEstimation(c uint16) uint
- type NocanNetworkController
- func (nc *NocanNetworkController) AutoPowerOffOnTermination(set bool)
- func (nc *NocanNetworkController) ExpectSystemMessage(node *models.Node, fn nocan.MessageType) (*nocan.Message, error)
- func (nc *NocanNetworkController) Initialize(with_reset bool, spi_speed uint) error
- func (nc *NocanNetworkController) Publish(node nocan.NodeId, channel nocan.ChannelId, data []byte) error
- func (nc *NocanNetworkController) ReceiveMessage(nodeId nocan.NodeId) (*nocan.Message, error)
- func (nc *NocanNetworkController) RequestPowerStatusUpdate()
- func (nc *NocanNetworkController) RunPinger(interval time.Duration)
- func (nc *NocanNetworkController) RunPowerMonitor(interval time.Duration)
- func (nc *NocanNetworkController) SendMessage(msg *nocan.Message) error
- func (nc *NocanNetworkController) SendSystemMessage(nodeId nocan.NodeId, fn nocan.MessageType, pm uint8, data []byte) error
- func (nc *NocanNetworkController) Serve() error
- func (nci *NocanNetworkController) SetCurrentLimit(limit uint16)
- func (nc *NocanNetworkController) SetPower(power_on bool)
- func (nci *NocanNetworkController) SetTerminationResistor(set bool)
- type NodeContext
- type NodeFirmwareOperation
Constants ¶
View Source
const ( NO_BUS_RESET = false BUS_RESET = true )
View Source
const ( NODE_OP_NONE = iota NODE_OP_UPLOAD_FLASH NODE_OP_DOWNLOAD_FLASH )
View Source
const ( FLASH_ORIGIN uint32 = 0 FLASH_LENGTH uint32 = 0x40000 FLASH_APP_ORIGIN uint32 = FLASH_ORIGIN + 0x2000 // 8K bootloader FLASH_APP_LENGTH uint32 = FLASH_LENGTH - 0x2000 FLASH_PAGE_SIZE uint32 = 64 )
* Currently there is only one model for nodes, so we can use consts. * In the future we will need a 'per-device' approach.
View Source
const DEFAULT_EXPECT_TIMEOUT = 3 * time.Second
Variables ¶
View Source
var Channels *models.ChannelCollection = models.NewChannelCollection()
View Source
var EventServer *socket.Server
View Source
var FLASH_DEVICE_SIGNATURE = [4]byte{0x10, 0x01, 0x00, 0x05}
View Source
var Nodes *models.NodeCollection = models.NewNodeCollection()
View Source
var PingerEnabled = false
View Source
var SystemProperties *properties.Properties = properties.New()
Functions ¶
func MilliAmpEstimation ¶
Types ¶
type NocanNetworkController ¶
type NocanNetworkController struct { DeviceInfo *device.Information // contains filtered or unexported fields }
var Bus *NocanNetworkController = NewNocanNetworkController()
func NewNocanNetworkController ¶
func NewNocanNetworkController() *NocanNetworkController
func (*NocanNetworkController) AutoPowerOffOnTermination ¶
func (nc *NocanNetworkController) AutoPowerOffOnTermination(set bool)
func (*NocanNetworkController) ExpectSystemMessage ¶
func (nc *NocanNetworkController) ExpectSystemMessage(node *models.Node, fn nocan.MessageType) (*nocan.Message, error)
func (*NocanNetworkController) Initialize ¶
func (nc *NocanNetworkController) Initialize(with_reset bool, spi_speed uint) error
func (*NocanNetworkController) ReceiveMessage ¶
func (*NocanNetworkController) RequestPowerStatusUpdate ¶
func (nc *NocanNetworkController) RequestPowerStatusUpdate()
func (*NocanNetworkController) RunPinger ¶
func (nc *NocanNetworkController) RunPinger(interval time.Duration)
func (*NocanNetworkController) RunPowerMonitor ¶
func (nc *NocanNetworkController) RunPowerMonitor(interval time.Duration)
func (*NocanNetworkController) SendMessage ¶
func (nc *NocanNetworkController) SendMessage(msg *nocan.Message) error
func (*NocanNetworkController) SendSystemMessage ¶
func (nc *NocanNetworkController) SendSystemMessage(nodeId nocan.NodeId, fn nocan.MessageType, pm uint8, data []byte) error
func (*NocanNetworkController) Serve ¶
func (nc *NocanNetworkController) Serve() error
func (*NocanNetworkController) SetCurrentLimit ¶
func (nci *NocanNetworkController) SetCurrentLimit(limit uint16)
func (*NocanNetworkController) SetPower ¶
func (nc *NocanNetworkController) SetPower(power_on bool)
func (*NocanNetworkController) SetTerminationResistor ¶
func (nci *NocanNetworkController) SetTerminationResistor(set bool)
type NodeContext ¶
type NodeContext struct {
// contains filtered or unexported fields
}
type NodeFirmwareOperation ¶
type NodeFirmwareOperation struct { Client *socket.ClientDescriptor Operation int // NODE_OP_... Progress *socket.NodeFirmwareProgressEvent Firmware *socket.NodeFirmwareEvent }
func NewNodeFirmwareOperation ¶
func NewNodeFirmwareOperation(client *socket.ClientDescriptor, op int, progress *socket.NodeFirmwareProgressEvent, firmware *socket.NodeFirmwareEvent) *NodeFirmwareOperation
Click to show internal directories.
Click to hide internal directories.