You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
494 B
22 lines
494 B
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/v2/errors/gerror"
|
|
"go.uber.org/zap"
|
|
"tgk-touch/internal/library/meterControl"
|
|
"tgk-touch/internal/module/maincontrollerClient"
|
|
)
|
|
|
|
func main() {
|
|
err := maincontrollerClient.UseSerialPort(`/dev/ttyS2`, 8600)
|
|
if err != nil {
|
|
panic(gerror.Wrap(err, "串口启动失败"))
|
|
}
|
|
power, err := meterControl.GetMeterControls(meterControl.ADL400).ReadTotalPower("", 0x04)
|
|
if err != nil {
|
|
panic(err)
|
|
return
|
|
}
|
|
zap.S().Debugf("power: %+v", power)
|
|
}
|