bmc

package
v0.0.0-...-f967be0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2023 License: BSD-3-Clause Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GPIO_INVERTED = 0x1

	GPIO_EVENT_UNKNOWN      = 0
	GPIO_EVENT_RISING_EDGE  = 1
	GPIO_EVENT_FALLING_EDGE = 2
)
View Source
const (
	GPIO_GET_CHIPINFO_IOCTL          = 0x8044b401
	GPIO_GET_LINEINFO_IOCTL          = 0xc048b402
	GPIO_GET_LINEHANDLE_IOCTL        = 0xc16cb403
	GPIO_GET_LINEEVENT_IOCTL         = 0xc030b404
	GPIOHANDLE_SET_LINE_VALUES_IOCTL = 0xc040b409
	GPIOHANDLE_GET_LINE_VALUES_IOCTL = 0xc040b408

	GPIOHANDLE_REQUEST_INPUT       = (1 << 0)
	GPIOHANDLE_REQUEST_OUTPUT      = (1 << 1)
	GPIOHANDLE_REQUEST_ACTIVE_LOW  = (1 << 2)
	GPIOHANDLE_REQUEST_OPEN_DRAIN  = (1 << 3)
	GPIOHANDLE_REQUEST_OPEN_SOURCE = (1 << 4)

	GPIOEVENT_REQUEST_RISING_EDGE  = (1 << 0)
	GPIOEVENT_REQUEST_FALLING_EDGE = (1 << 1)
	GPIOEVENT_REQUEST_BOTH_EDGES   = GPIOEVENT_REQUEST_RISING_EDGE | GPIOEVENT_REQUEST_FALLING_EDGE

	GPIOEVENT_EVENT_RISING_EDGE  = 1
	GPIOEVENT_EVENT_FALLING_EDGE = 2
)
View Source
const (
	ND_ROUTER_ADVERT = 134
	ND_OPT_RDNSS     = 25
)

Variables

This section is empty.

Functions

func FakeGpioImpl

func FakeGpioImpl(p GpioPlatform, startupState map[uint32]bool) *fakeGpio

func LogGpio

func LogGpio(line string, c chan bool, d bool)

func NativeEndian

func NativeEndian() binary.ByteOrder

func Reboot

func Reboot()

func Shell

func Shell()

func StartNcsi

func StartNcsi(iface string)

func Startup

func Startup(p Platform) (error, chan error)

func StartupWithConfig

func StartupWithConfig(p Platform, c *config.Config) (error, chan error)

Types

type Addresser

type Addresser interface {
	IPv4() net.IP
	IPv6() net.IP
	AddressLifetime() time.Duration
}

type FanPlatform

type FanPlatform interface {
	PwmMap() map[int]string
	FanMap() map[int]string
}

type FanSystem

type FanSystem struct {
	// contains filtered or unexported fields
}

func (*FanSystem) FanCount

func (f *FanSystem) FanCount() int

func (*FanSystem) ReadFanPercentage

func (f *FanSystem) ReadFanPercentage(fan int) (int, error)

func (*FanSystem) ReadFanRpm

func (f *FanSystem) ReadFanRpm(fan int) (int, error)

type GpioCallback

type GpioCallback func(line string, c chan bool, initial bool)

type GpioPlatform

type GpioPlatform interface {
	GpioNameToPort(string) (uint32, bool)
	GpioPortToName(uint32) (string, bool)
	InitializeGpio(g *GpioSystem) error
}

type GpioSystem

type GpioSystem struct {
	// contains filtered or unexported fields
}

func NewGpioSystem

func NewGpioSystem(p GpioPlatform, impl gpioImpl) *GpioSystem

func (*GpioSystem) Button

func (g *GpioSystem) Button(b pb.Button) chan chan bool

func (*GpioSystem) Hog

func (g *GpioSystem) Hog(lines map[string]bool)

func (*GpioSystem) ManageButton

func (g *GpioSystem) ManageButton(line string, b pb.Button, flags int)

func (*GpioSystem) Monitor

func (g *GpioSystem) Monitor(lines map[string]GpioCallback)

func (*GpioSystem) PressButton

func (g *GpioSystem) PressButton(ctx context.Context, b pb.Button, durMs uint32) (chan bool, error)

type NDUserOpt

type NDUserOpt struct {
	Family   uint8
	Ifindex  uint32
	ICMPType uint8
	ICMPCode uint8
	RDNSS    []*RDNSSOption
}

type Platform

type Platform interface {
	InitializeSystem() error
	HostUart() (string, int)
	GpioPlatform
	FanPlatform
}

type RDNSSOption

type RDNSSOption struct {
	Lifetime time.Duration
	Server   []*net.IP
}

type RPCServer

type RPCServer interface {
	EnableRemote(*tls.Certificate) error
}

type Uart

type Uart interface {
	Read([]byte) (int, error)
	Write([]byte) (int, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL