Documentation
¶
Index ¶
- Variables
- type ASDUCall
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect() error
- func (c *Client) IsConnected() bool
- func (c *Client) SendClockSynchronizationCmd(addr uint16, t time.Time) error
- func (c *Client) SendCmd(addr uint16, typeId asdu.TypeID, ioa asdu.InfoObjAddr, value any) error
- func (c *Client) SendCounterInterrogationCmd(addr uint16) error
- func (c *Client) SendInterrogationCmd(addr uint16) error
- func (c *Client) SendReadCmd(addr uint16, ioa uint) error
- func (c *Client) SendResetProcessCmd(addr uint16) error
- func (c *Client) SendTestCmd(addr uint16) error
- func (c *Client) SetConnectionLostHandler(f func(c *Client))
- func (c *Client) SetLogCfg(cfg LogCfg)
- func (c *Client) SetOnConnectHandler(f func(c *Client))
- func (c *Client) SetServerActiveHandler(f func(c *Client))
- type DataType
- type LogCfg
- type Settings
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NotConnected = errors.New("the service request can not be executed because the client is not yet connected")
)
Functions ¶
This section is empty.
Types ¶
type ASDUCall ¶
type ASDUCall interface {
// OnInterrogation 总召唤回复
OnInterrogation(*asdu.ASDU) error
// OnCounterInterrogation 总计数器回复
OnCounterInterrogation(*asdu.ASDU) error
// OnRead 读定值回复
OnRead(*asdu.ASDU) error
// OnTestCommand 测试下发回复
OnTestCommand(*asdu.ASDU) error
// OnClockSync 时钟同步回复
OnClockSync(*asdu.ASDU) error
// OnResetProcess 进程重置回复
OnResetProcess(*asdu.ASDU) error
// OnDelayAcquisition 延迟获取回复
OnDelayAcquisition(*asdu.ASDU) error
// OnASDU 数据回复或控制回复
OnASDU(*asdu.ASDU) error
}
ASDUCall is the interface of client handler
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) IsConnected ¶
func (*Client) SendClockSynchronizationCmd ¶
SendClockSynchronizationCmd 发起时钟同步
func (*Client) SendCounterInterrogationCmd ¶
SendCounterInterrogationCmd 发起累积量召唤
func (*Client) SendInterrogationCmd ¶
SendInterrogationCmd 发起总召唤
func (*Client) SendReadCmd ¶
SendReadCmd 发起读命令
func (*Client) SendResetProcessCmd ¶
SendResetProcessCmd 发起复位进程命令
func (*Client) SetConnectionLostHandler ¶
SetConnectionLostHandler 连接断开后回调,如果连接重复断开也会回调,所以存在多次调用的情况
func (*Client) SetOnConnectHandler ¶
SetOnConnectHandler 连接成功后回调,如果连接断开重新连接上也会回调,所以存在多次调用的情况
func (*Client) SetServerActiveHandler ¶
SetServerActiveHandler 激活确认后回调,如果连接断开重新连接上也会回调,所以存在多次调用的情况
type DataType ¶
type DataType int
const ( SinglePoint DataType = iota // 单点信息 DoublePoint // 双点信息 MeasuredValueScaled // 测量值,标度化值信息 MeasuredValueNormal // 测量值,规一化值信息 StepPosition // 步位置信息 BitString32 // 比特位串信息 MeasuredValueFloat // 测量值,短浮点数信息 IntegratedTotals // 累计量信息 EventOfProtectionEquipment // 继电器保护设备事件信息 PackedStartEventsOfProtectionEquipment // 继电器保护设备事件信息 PackedOutputCircuitInfo // 继电器保护设备成组输出电路信息 PackedSinglePointWithSCD // 带变位检出的成组单点信息 SingleCommandInfo DoubleCommandInfo StepCommandInfo SetPointCommandNormalInfo SetPointCommandScaledInfo SetPointCommandFloatInfo BitsString32CommandInfo UNKNOWN // 未知的 )
func GetDataType ¶
type LogCfg ¶
type LogCfg struct {
Enable bool //是否开启log
LogProvider clog.LogProvider
}
Click to show internal directories.
Click to hide internal directories.