Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MSpNa1 不带游标的单点遥信,3个字节的地址,1个字节的值 MSpNa1 = 1 // MDpNa1 不带时标的双点遥信,每个遥信占1个字节 MDpNa1 = 3 // MMeNc1 带品质描述的测量值,每个遥测值占3个字节 MMeNa1 = 9 // MMeNc1 带品质描述的浮点值,每个遥测值占5个字节 MMeNc1 = 13 // MItNa1 电度总量,每个遥脉值占5个字节 MItNa1 = 15 // MSpTb1 带游标的单点遥信,3个字节的地址,1个字节的值,7个字节短时标 MSpTb1 = 30 // MEiNA1 初始化结束 MEiNA1 = 70 // CIcNa1 总召唤 CIcNa1 = 100 // CCiNa1 电度总召唤 CCiNa1 = 101 )
数据类型
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APDU ¶
type APDU struct {
APCI *APCI
ASDU *ASDU
Len int
ASDULen int
CtrType byte
CtrFrame interface{}
Signals []*Signal
}
APDU 104数据包
type ASDU ¶
type ASDU struct {
TypeID byte // 类型标识
Sequence bool // 是否连续
Length byte // 可变结构限定词
Cause uint16 // 传输原因
PublicAddress uint16 // 公共地址
Ts float64 // 毫秒级时间戳
}
ASDU 应用服务数据单元
type Client ¶
type Client struct {
DataHandlerInterface
IsConnected bool
Logger *logrus.Logger
// contains filtered or unexported fields
}
Client 104客户端
func NewClient ¶
func NewClient(handler DataHandlerInterface, address string, logger *logrus.Logger, tlsConfig *tls.Config, Cert bool) *Client
NewClient 初始化客户端,连接失败,每隔10秒重试
func (*Client) SendDoubleCmd ¶
SendDoubleCmd 发送双点遥控
func (*Client) SendElectricityTotalCall ¶
func (c *Client) SendElectricityTotalCall()
SendTotalCall 发送电度总召唤
func (*Client) SendSingleCmd ¶
SendSingleCmd 发送单点遥控
type DataHandlerInterface ¶
Click to show internal directories.
Click to hide internal directories.