mirror of https://github.com/OrbTools/OrbCommon
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
475 B
Go
23 lines
475 B
Go
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
"os"
|
|
"strings"
|
|
|
|
"github.com/OrbTools/OrbCommon/devices"
|
|
xdr "github.com/davecgh/go-xdr/xdr2"
|
|
)
|
|
|
|
func main() {
|
|
files, _ := os.ReadDir("devices/json/")
|
|
for _, file := range files {
|
|
data, _ := os.ReadFile("devices/json/" + file.Name())
|
|
DevDef := &devices.DeviceDef{}
|
|
json.Unmarshal(data, DevDef)
|
|
xdo, _ := os.Create("devices/xdr/" + strings.Split(file.Name(), ".")[0] + ".bin")
|
|
xdr.Marshal(xdo, DevDef)
|
|
xdo.Close()
|
|
}
|
|
}
|