mirror of
https://github.com/Fishwaldo/go-dcdc200.git
synced 2025-03-15 11:31:22 +00:00
Golang Package for mini-box dcdc-usb power supply
.github | ||
.vscode | ||
cmd | ||
internal | ||
.gitignore | ||
codecov.yml | ||
dcdcmodet_string.go | ||
dcdcstatet_string.go | ||
dcdcusb.go | ||
dcdcusb_test.go | ||
dcdcusbexample_test.go | ||
definitions.go | ||
doc.go | ||
go.mod | ||
go.sum | ||
LICENSE | ||
README.md | ||
running.cap | ||
shutdown.cap |
Go-LogAdapter
Package go-dcdcusb interfaces with the DCDCUSB power supply from mini-box (https://www.mini-box.com/DCDC-USB) via USB port and allows you to retrive the status of the power supply
it depends upon GoUSB which in turn depends upon the libusb C library, thus CGO is required for this module
Please see the GoUSB pages for hints on compiling for platforms other than linux
Building
Compile with the tag nogousb to disable compiling with USB Support. Then the only option available is a Simulator Mode that replays a previously captured session.
Sub Packages
Examples
dc := dcdcusb.DcDcUSB{}
dc.Init(stdlogger.DefaultLogger(), false)
if ok, err := dc.Scan(); !ok {
log.Fatalf("Scan Failed: %v", err)
return
}
defer dc.Close()
for i := 0; i < 100; i++ {
ctx, cancel := context.WithTimeout(context.Background(), (1 * time.Second))
dc.GetAllParam(ctx)
cancel()
time.Sleep(1 * time.Second)
}
dc.Close()
Readme created from Go doc with goreadme