fix compile errors more

This commit is contained in:
richardsonjack 2018-04-19 18:34:08 +09:30
parent 23e2409c75
commit 3f76c64cf9
1 changed files with 20 additions and 3 deletions

View File

@ -28,12 +28,16 @@ LICENSE
package main package main
import ( import (
"errors"
"os/exec"
"flag" "flag"
"strconv" "strconv"
"time" "time"
"bitbucket.org/ausocean/av/revid" "bitbucket.org/ausocean/av/revid"
"bitbucket.org/ausocean/IoT/pi/netsender" "bitbucket.org/ausocean/IoT/pi/netsender"
linuxproc "github.com/c9s/goprocinfo/linux"
) )
// Indexes for configFlags // Indexes for configFlags
@ -67,6 +71,19 @@ const (
revidStopTime = 5 revidStopTime = 5
) )
const (
lightRelayPin = 19
ds18b20Temp = 60
dht11Temp = 40
dht11Hum = 41
dht22Temp = 50
dht22Hum = 51
dhtPin = 22
cpuTemp = 21
cpuUsage = 20
priority = 25
)
// Globals // Globals
var ( var (
configReceived bool = true configReceived bool = true
@ -215,8 +232,8 @@ func periodicNetsenderReport(){
} }
} }
inputs := {"X20", "X21"}
if _, reconfig, err := netsender.Send(netsender.RequestPoll, criticalInputs); err != nil { if _, reconfig, err := netsender.Send(netsender.RequestPoll, inputs); err != nil {
config.Logger.Log("Error", err.Error()) config.Logger.Log("Error", err.Error())
} }
@ -366,7 +383,7 @@ func revidReportActions(pin int) (int, error) {
stat, err = linuxproc.ReadStat("/proc/stat") stat, err = linuxproc.ReadStat("/proc/stat")
if err != nil { if err != nil {
return -1, errors.New("CPU Uage Read Err: " + err.Error()) return -1, errors.New("CPU Usage Read Err: " + err.Error())
} }
total2 := stat.CPUStatAll.User + stat.CPUStatAll.Nice + stat.CPUStatAll.System + total2 := stat.CPUStatAll.User + stat.CPUStatAll.Nice + stat.CPUStatAll.System +
stat.CPUStatAll.Idle + stat.CPUStatAll.IOWait + stat.CPUStatAll.IRQ + stat.CPUStatAll.Idle + stat.CPUStatAll.IOWait + stat.CPUStatAll.IRQ +