Skip to content

brendan-ta/goiio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goiio

goiio is a Go client to interact with IIO (industrial I/O).

Introduction

go-iio was written to access remote iiod instanced, since libiio does not seem to have golang bindings by itself. It's main use case is connecting with remote IIOd instances: local IIO access is out of scope, you'll need to run iiod.

Example

// Create TCP connection
c, err := goiio.New("my-sensor.home.lan:30431")
if err != nil {
  panic(err)
}

// Populate the values in attributes
if err = c.FetchAttributes(); err != nil {
  panic(err)
}

// Loop through all devices
for _, dev := range c.Context.Devices {
  log.Infof("Device: id=%s, name=%s", dev.ID, dev.Name)
  for _, ch := range dev.Channels {
    log.Infof("  Channel: id=%s", ch.ID)
    for _, attr := range ch.Attributes {
      log.Infof("    Attribute: %s, value: %0.3f", attr.Name, attr.Value)
    }
  }
}

Installation

Install goiio using the "go get" command:

go get github.com/brendan-ta/goiio

Minimum Golang dependency: 1.16

Dependencies

Standard Go library imports:

Related Projects

Resources

This project was forked from the original project goiio however due to go modules forking a project meant collisions with module names. Therefore this is simply an evolution of the original project:

License

goiio is available under the GNU AGPL Licence.

About

Golang industrial I/O client

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%