Hi,
I am having a hard time understanding the nature of the “echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots”
I have written the following program in Go:
package bbbdevtreeovly
import (
// “io”
// “bytes”
// “fmt”
“io/ioutil”
“log”
“os”
// “os/exec”
// “strings”
“path/filepath”
)
const (
slotsDir string = /sys/devices/
// Find BBB’s slots
)
func Load_dto(dtoFileName string, dtoFilePath string) (err error) {
log.SetPrefix(BBB Device Tree Overlay:
)
slotFiles := make([]os.FileInfo, 100)
slotFiles, err = ioutil.ReadDir(slotsDir)
var i int
for i = 0; i < len(slotFiles); i++ {
found, _ := filepath.Match(bone_capemgr.*
, slotFiles[i].Name())
if found {
break
}
}
log.Println(“This is the new program…”, “\n”)
slotsLoc := filepath.Join(slotsDir, slotFiles[i].Name(), slots
)
log.Println("DTO File: ", dtoFileName, “\n”)
slots, err := os.Open(slotsLoc)
if err != nil {
log.Println(err)
return err
}
defer slots.Close()
log.Println("Slots location: ", slots.Name(), “\n”)
slots.Write([]byte(dtoFileName))
// slots.Write([]byte(“cape_bone_iio”))
return nil
}
/*