Documentation
¶
Index ¶
- Constants
- Variables
- func C2GoBool(i C.int) bool
- func C2GoStr(str *C.char) string
- func GetIedClientError(err C.IedClientError) error
- func Go2CBool(b bool) C.int
- func Go2CStr(str string) *C.char
- func IsBitSet(n int, pos uint) bool
- type Client
- func (c *Client) Close()
- func (c *Client) ControlForDirectWithEnhancedSecurity(objectRef string, value bool) error
- func (c *Client) ControlForDirectWithNormalSecurity(objectRef string, value bool) error
- func (c *Client) ControlForSboWithEnhancedSecurity(objectRef string, value bool) error
- func (c *Client) ControlForSboWithNormalSecurity(objectRef string, value bool) error
- func (c *Client) GetSG(objectRef string) (*SettingGroup, error)
- func (c *Client) GetVariableSpecType(objectReference string, fc FC) (MmsType, error)
- func (c *Client) Read(objectRef string, fc FC) (interface{}, error)
- func (c *Client) ReadBool(objectRef string, fc FC) (bool, error)
- func (c *Client) ReadDataSet(objectRef string) ([]*MmsValue, error)
- func (c *Client) ReadFloat(objectRef string, fc FC) (float32, error)
- func (c *Client) ReadInt32(objectRef string, fc FC) (int32, error)
- func (c *Client) ReadInt64(objectRef string, fc FC) (int64, error)
- func (c *Client) ReadRbcValues(objectReference string) (*ClientReportControlBlock, error)
- func (c *Client) ReadString(objectRef string, fc FC) (string, error)
- func (c *Client) ReadUint32(objectRef string, fc FC) (uint32, error)
- func (c *Client) SetRbcValues(objectReference string, settings ClientReportControlBlock) error
- func (c *Client) Write(objectRef string, fc FC, value interface{}) error
- func (c *Client) WriteSG(ld, ln, objectRef string, fc FC, actSG int, value interface{}) error
- type ClientReportControlBlock
- type DataAttribute
- type DataObject
- type DataSet
- type FC
- type IedModel
- type IedServer
- func (is *IedServer) Destroy()
- func (is *IedServer) IsRunning() bool
- func (is *IedServer) LockDataModel()
- func (is *IedServer) Start(port int)
- func (is *IedServer) Stop()
- func (is *IedServer) UnlockDataModel()
- func (is *IedServer) UpdateFloatAttributeValue(attr *DataAttribute, value float32)
- func (is *IedServer) UpdateInt32AttributeValue(attr *DataAttribute, value int32)
- func (is *IedServer) UpdateUTCTimeAttributeValue(attr *DataAttribute, value int64)
- func (is *IedServer) UpdateVisibleStringAttributeValue(attr *DataAttribute, value string)
- type LogicalDevice
- type LogicalNode
- func (n *LogicalNode) CreateDataObjectCDC_APC(name string, ctlModel int) *DataObject
- func (n *LogicalNode) CreateDataObjectCDC_ENS(name string) *DataObject
- func (n *LogicalNode) CreateDataObjectCDC_SAV(name string, isInteger bool) *DataObject
- func (n *LogicalNode) CreateDataObjectCDC_VSS(name string) *DataObject
- func (ln *LogicalNode) CreateDataSet(name string) *DataSet
- type MmsType
- type MmsValue
- type OptFlds
- type SettingGroup
- type Settings
- type TrgOps
Constants ¶
const ( ActDA = "%s/%s.SGCB.ActSG" EditDA = "%s/%s.SGCB.EditSG" CnfDA = "%s/%s.SGCB.CnfEdit" )
Variables ¶
var ( NotConnected = errors.New("the service request can not be executed because the client is not yet connected") AlreadyConnected = errors.New("connect service not execute because the client is already connected") ConnectionLost = errors.New("the service request can not be executed caused by a loss of connection") ServiceNotSupported = errors.New("the service or some given parameters are not supported by the client stack or by the server") ConnectionRejected = errors.New("connection rejected by server") OutstandingCallLimitReached = errors.New("cannot send request because outstanding call limit is reached") UserProvidedInvalidArgument = errors.New("API function has been called with an invalid argument") EnableReportFailedDatasetMismatch = errors.New("API function has been called with an invalid argument") ObjectReferenceInvalid = errors.New("the object provided object reference is invalid (there is a syntactical error)") UnexpectedValueReceived = errors.New("received object is of unexpected type") Timeout = errors.New("the communication to the server failed with a timeout") AccessDenied = errors.New("the server rejected the access to the requested object/service due to access control") ObjectDoesNotExist = errors.New("the server reported that the requested object does not exist (returned by server)") ObjectExists = errors.New("the server reported that the requested object already exists") ObjectAccessUnsupported = errors.New("the server does not support the requested access method (returned by server)") TypeInconsistent = errors.New("the server expected an object of another type (returned by server)") ObjectUndefined = errors.New("the specified object is not defined in the server (returned by server)") InvalidAddress = errors.New("the specified address is invalid (returned by server)") HardwareFault = errors.New("service failed due to a hardware fault (returned by server)") TypeUnsupported = errors.New("the requested data type is not supported by the server (returned by server)") ObjectAttributeInconsistent = errors.New("the provided attributes are inconsistent (returned by server)") ObjectValueInvalid = errors.New("the provided object value is invalid (returned by server)") ObjectInvalidated = errors.New("the object is invalidated (returned by server)") MalformedMessage = errors.New("received an invalid response message from the server") ServiceNotImplemented = errors.New("service not implemented") Unknown = errors.New("unknown error") StructureMustBeMmsValue = errors.New("structure type must be MmsValue array") CreateControlObjectClientFail = errors.New("control object not found in server") ControlObjectFail = errors.New("control object fail") ControlSelectFail = errors.New("select control fail") UnSupportOperation = errors.New("un support operation") )
Functions ¶
func GetIedClientError ¶
func GetIedClientError(err C.IedClientError) error
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ControlForDirectWithEnhancedSecurity ¶
ControlForDirectWithEnhancedSecurity 控制模式 3[direct-with-enhanced-security]
func (*Client) ControlForDirectWithNormalSecurity ¶
ControlForDirectWithNormalSecurity 控制模式 1[direct-with-normal-security]
func (*Client) ControlForSboWithEnhancedSecurity ¶
ControlForSboWithEnhancedSecurity 控制模式 4[sbo-with-enhanced-security]
func (*Client) ControlForSboWithNormalSecurity ¶
ControlForSboWithNormalSecurity 控制模式 2[sbo-with-normal-security]
func (*Client) GetSG ¶
func (c *Client) GetSG(objectRef string) (*SettingGroup, error)
GetSG 获取SettingGroup
func (*Client) GetVariableSpecType ¶
GetVariableSpecType 获取类型规格
func (*Client) ReadDataSet ¶
ReadDataSet 读取DataSet
func (*Client) ReadRbcValues ¶
func (c *Client) ReadRbcValues(objectReference string) (*ClientReportControlBlock, error)
func (*Client) ReadString ¶
ReadString 读取string类型值
func (*Client) ReadUint32 ¶
ReadUint32 读取uint32类型值
func (*Client) SetRbcValues ¶
func (c *Client) SetRbcValues(objectReference string, settings ClientReportControlBlock) error
type DataAttribute ¶
type DataAttribute struct {
// contains filtered or unexported fields
}
type DataObject ¶
type DataObject struct {
// contains filtered or unexported fields
}
func (*DataObject) GetChild ¶
func (do *DataObject) GetChild(name string) *DataAttribute
type DataSet ¶
type DataSet struct {
// contains filtered or unexported fields
}
func (*DataSet) AddDataSetEntry ¶
AddDataSetEntry adds a new DataSetEntry to this DataSet.
type FC ¶
type FC int
const ( // ST Status information ST FC = iota // MX Measurands - analogue values MX // SP Setpoint SP // SV Substitution SV // CF Configuration CF // DC Description DC // SG Setting group SG // SE Setting group editable SE // SR service response / service tracking SR // OR Operate received OR // BL Blocking BL // EX Extended definition EX // CO Control, deprecated but kept here for backward compatibility CO // RP Unbuffered Reporting RP // BR Buffered Reporting BR // ALL All FCs - wildcard value ALL FC = 99 NONE FC = -1 )
fc types
type IedModel ¶
type IedModel struct {
// contains filtered or unexported fields
}
func NewIedModel ¶
func (*IedModel) CreateLogicalDevice ¶
func (m *IedModel) CreateLogicalDevice(name string) *LogicalDevice
type IedServer ¶
type IedServer struct {
// contains filtered or unexported fields
}
func (*IedServer) Destroy ¶
func (is *IedServer) Destroy()
Destroy frees all resources associated with the IedServer.
func (*IedServer) LockDataModel ¶
func (is *IedServer) LockDataModel()
LockDataModel locks the data model of the IedServer.
func (*IedServer) UnlockDataModel ¶
func (is *IedServer) UnlockDataModel()
UnlockDataModel unlocks the data model of the IedServer.
func (*IedServer) UpdateFloatAttributeValue ¶
func (is *IedServer) UpdateFloatAttributeValue(attr *DataAttribute, value float32)
UpdateFloatAttributeValue updates a DataAttribute with a float value.
func (*IedServer) UpdateInt32AttributeValue ¶
func (is *IedServer) UpdateInt32AttributeValue(attr *DataAttribute, value int32)
UpdateInt32AttributeValue updates a DataAttribute with an Int32 value.
func (*IedServer) UpdateUTCTimeAttributeValue ¶
func (is *IedServer) UpdateUTCTimeAttributeValue(attr *DataAttribute, value int64)
UpdateUTCTimeAttributeValue updates a DataAttribute with a UTC time value.
func (*IedServer) UpdateVisibleStringAttributeValue ¶
func (is *IedServer) UpdateVisibleStringAttributeValue(attr *DataAttribute, value string)
UpdateVisibleStringAttributeValue updates a DataAttribute with a visible string value.
type LogicalDevice ¶
type LogicalDevice struct {
// contains filtered or unexported fields
}
func (*LogicalDevice) CreateLogicalNode ¶
func (d *LogicalDevice) CreateLogicalNode(name string) *LogicalNode
type LogicalNode ¶
type LogicalNode struct {
// contains filtered or unexported fields
}
func (*LogicalNode) CreateDataObjectCDC_APC ¶
func (n *LogicalNode) CreateDataObjectCDC_APC(name string, ctlModel int) *DataObject
func (*LogicalNode) CreateDataObjectCDC_ENS ¶
func (n *LogicalNode) CreateDataObjectCDC_ENS(name string) *DataObject
func (*LogicalNode) CreateDataObjectCDC_SAV ¶
func (n *LogicalNode) CreateDataObjectCDC_SAV(name string, isInteger bool) *DataObject
func (*LogicalNode) CreateDataObjectCDC_VSS ¶
func (n *LogicalNode) CreateDataObjectCDC_VSS(name string) *DataObject
func (*LogicalNode) CreateDataSet ¶
func (ln *LogicalNode) CreateDataSet(name string) *DataSet
CreateDataSet creates a new DataSet under this LogicalNode.