bp35a1

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CRLF = "\r\n"
View Source
const RET_ERXUDP = "ERXUDP" // UDP受信イベント
View Source
const RET_FAIL = "FAIL ER"
View Source
const RET_JOIN_COMPLETE = "EVENT 25 " // SKJOIN に対する応答。
View Source
const RET_OK = "OK"
View Source
const RET_PAN_ADDR = "Addr:"
View Source
const RET_PAN_CHANNEL = "Channel:"

PANDESC

View Source
const RET_PAN_CHANNEL_PAGE = "Channel Page:"
View Source
const RET_PAN_ID = "Pan ID:"
View Source
const RET_PAN_LQI = "LQI:"
View Source
const RET_PAN_PAIR_ID = "PairID:"
View Source
const RET_SCAN_COMPLETE = "EVENT 22 " // SKSCAN終了
View Source
const RET_SCAN_FOUND = "EPANDESC" // SKSCANの機器情報が取得された場合

Variables

View Source
var LAST_TID uint16 = 1000
View Source
var LONG_TIMEOUT_DURATION = 60 * time.Second
View Source
var RET_STOP_WORDS = []string{RET_OK, RET_FAIL}

一般的な応答ワード [OK, FAIL]

View Source
var STD_TIMEOUT_DURATION = 15 * time.Second

Functions

func Close

func Close() error

Closeはgo-serial内でポートが開いているかの判定をしているので常に実行しても安全。

func Connect

func Connect() error

func GetSmartMeterInitialData

func GetSmartMeterInitialData(ipv6 string) error

一度だけ取得すればあとは変わらないものを取得して、パーサーに渡す

func InitializeBrouteConnection

func InitializeBrouteConnection() (string, error)

アクティブスキャン〜Bルート接続完了までを実行する @return スマートメーターのipv6アドレス

func StartConnection

func StartConnection() error

Types

type ElectricData

type ElectricData map[string]decimal.Decimal
{
	RphaseAmp float64 // R相電流アンペア Signed Short (0.1A単位)
	TphaseAmp float64 // T相電流アンペア Signed Short (0.1A単位)
	TotalAmp  float64 // 合計電流アンペア Signed Short (0.1A単位)
	DeltakWh  float64 // 積算電力量
	Watt      int     // 瞬間電力量
}

func GetDeltaConsumptionData

func GetDeltaConsumptionData(ipv6 string) (ElectricData, error)

瞬間電力消費量を取得する

func GetNowConsumptionData

func GetNowConsumptionData(ipv6 string) (ElectricData, error)

瞬間電力消費量を取得する

type SmartMeter

type SmartMeter struct {
	Channel     string
	ChannelPage string
	PanId       string
	Addr        string
	LQI         string
	PairId      string
}

func (SmartMeter) String

func (sm SmartMeter) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL