- .NET API: Added Client.ReportControlBlock.HasResvTms method

- updated CHANGELOG
pull/147/head
Michael Zillgith 7 years ago
parent e803003441
commit d7e01738eb

@ -1,3 +1,17 @@
Changes to version 1.3.3
------------------------
- IEC 61850 server: optimized report buffer handling for buffered reporting (save memory and encoding time)
- IEC 61850 client: fixed problem - IedConnection cannot be reused after IedConnection_close (github #124)
- IEC 61850 server: added support for pre configured client with ClientLN
- IEC 61850 client: added function ClientReportControlBlock_hasResvTms
- IEC 61850 server: don't clear owner when client disables BRCB (RptEna = false)
- IED Server: added ResvTms handling for BRCB
- SV publisher: fixed length calculation
- IEC 61850 server: added support for segmented reporting
- fixed bug in windows socket abstraction
- fixed client TCP keep alive problem (see github #115)
- MMS server: read service - return data access error for component access to simple variable
Changes to version 1.3.2 Changes to version 1.3.2
------------------------ ------------------------
- MMS client/server: added support for component alternate access for generic variable read requests - MMS client/server: added support for component alternate access for generic variable read requests

@ -28,18 +28,18 @@ using IEC61850.Common;
namespace IEC61850 namespace IEC61850
{ {
namespace Client namespace Client
{ {
/// <summary> /// <summary>
/// Report handler. /// Report handler.
/// </summary> /// </summary>
/// <param name="report">represents the received report. DON'T use this object /// <param name="report">represents the received report. DON'T use this object
/// outside the scope of the report handler!</param> /// outside the scope of the report handler!</param>
public delegate void ReportHandler (Report report, object parameter); public delegate void ReportHandler(Report report, object parameter);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void InternalReportHandler (IntPtr parameter, IntPtr report); internal delegate void InternalReportHandler(IntPtr parameter, IntPtr report);
/// <summary> /// <summary>
/// Report control block (RCB) representation. /// Report control block (RCB) representation.
@ -50,208 +50,217 @@ namespace IEC61850
/// Values at the server are only affected when the SetRCBValues method is called. /// Values at the server are only affected when the SetRCBValues method is called.
/// </description> /// </description>
public class ReportControlBlock : IDisposable public class ReportControlBlock : IDisposable
{ {
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ClientReportControlBlock_create (string dataAttributeReference); static extern IntPtr ClientReportControlBlock_create(string dataAttributeReference);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_destroy (IntPtr self); static extern void ClientReportControlBlock_destroy(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)] [return: MarshalAs(UnmanagedType.I1)]
static extern bool ClientReportControlBlock_isBuffered (IntPtr self); static extern bool ClientReportControlBlock_isBuffered(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ClientReportControlBlock_getRptId (IntPtr self); static extern IntPtr ClientReportControlBlock_getRptId(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setRptId (IntPtr self, string rptId); static extern void ClientReportControlBlock_setRptId(IntPtr self, string rptId);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)] [return: MarshalAs(UnmanagedType.I1)]
static extern bool ClientReportControlBlock_getRptEna (IntPtr self); static extern bool ClientReportControlBlock_getRptEna(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setRptEna(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool rptEna); static extern void ClientReportControlBlock_setRptEna(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool rptEna);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)] [return: MarshalAs(UnmanagedType.I1)]
static extern bool ClientReportControlBlock_getResv (IntPtr self); static extern bool ClientReportControlBlock_getResv(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setResv (IntPtr self, [MarshalAs(UnmanagedType.I1)] bool resv); static extern void ClientReportControlBlock_setResv(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool resv);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ClientReportControlBlock_getDataSetReference (IntPtr self); static extern IntPtr ClientReportControlBlock_getDataSetReference(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setDataSetReference (IntPtr self, string dataSetReference); static extern void ClientReportControlBlock_setDataSetReference(IntPtr self, string dataSetReference);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern UInt32 ClientReportControlBlock_getConfRev (IntPtr self); static extern UInt32 ClientReportControlBlock_getConfRev(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern int ClientReportControlBlock_getOptFlds (IntPtr self); static extern int ClientReportControlBlock_getOptFlds(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setOptFlds (IntPtr self, int optFlds); static extern void ClientReportControlBlock_setOptFlds(IntPtr self, int optFlds);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern UInt32 ClientReportControlBlock_getBufTm (IntPtr self); static extern UInt32 ClientReportControlBlock_getBufTm(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setBufTm (IntPtr self, UInt32 bufTm); static extern void ClientReportControlBlock_setBufTm(IntPtr self, UInt32 bufTm);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern UInt16 ClientReportControlBlock_getSqNum (IntPtr self); static extern UInt16 ClientReportControlBlock_getSqNum(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern int ClientReportControlBlock_getTrgOps (IntPtr self); static extern int ClientReportControlBlock_getTrgOps(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setTrgOps (IntPtr self, int trgOps); static extern void ClientReportControlBlock_setTrgOps(IntPtr self, int trgOps);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern UInt32 ClientReportControlBlock_getIntgPd (IntPtr self); static extern UInt32 ClientReportControlBlock_getIntgPd(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setIntgPd (IntPtr self, UInt32 intgPd); static extern void ClientReportControlBlock_setIntgPd(IntPtr self, UInt32 intgPd);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)] [return: MarshalAs(UnmanagedType.I1)]
static extern bool ClientReportControlBlock_getGI (IntPtr self); static extern bool ClientReportControlBlock_getGI(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setGI (IntPtr self, [MarshalAs(UnmanagedType.I1)] bool gi); static extern void ClientReportControlBlock_setGI(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool gi);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)] [return: MarshalAs(UnmanagedType.I1)]
static extern bool ClientReportControlBlock_getPurgeBuf (IntPtr self); static extern bool ClientReportControlBlock_getPurgeBuf(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setPurgeBuf (IntPtr self, [MarshalAs(UnmanagedType.I1)] bool purgeBuf); static extern void ClientReportControlBlock_setPurgeBuf(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool purgeBuf);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern Int16 ClientReportControlBlock_getResvTms (IntPtr self); [return: MarshalAs(UnmanagedType.I1)]
static extern bool ClientReportControlBlock_hasResvTms(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setResvTms (IntPtr self, Int16 resvTms); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern Int16 ClientReportControlBlock_getResvTms(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ClientReportControlBlock_getEntryId (IntPtr self); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setResvTms(IntPtr self, Int16 resvTms);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setEntryId (IntPtr self, IntPtr entryId); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ClientReportControlBlock_getEntryId(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern UInt64 ClientReportControlBlock_getEntryTime (IntPtr self); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void ClientReportControlBlock_setEntryId(IntPtr self, IntPtr entryId);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ClientReportControlBlock_getOwner (IntPtr self); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern UInt64 ClientReportControlBlock_getEntryTime(IntPtr self);
private IntPtr self;
private IedConnection iedConnection = null; [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
private string objectReference; static extern IntPtr ClientReportControlBlock_getOwner(IntPtr self);
private bool flagRptId = false;
private bool flagRptEna = false; private IntPtr self;
private bool flagResv = false; private IedConnection iedConnection = null;
private bool flagDataSetReference = false; private string objectReference;
private bool flagConfRev = false; private bool flagRptId = false;
private bool flagOptFlds = false; private bool flagRptEna = false;
private bool flagBufTm = false; private bool flagResv = false;
private bool flagSqNum = false; private bool flagDataSetReference = false;
private bool flagTrgOps = false; private bool flagConfRev = false;
private bool flagIntgPd = false; private bool flagOptFlds = false;
private bool flagGI = false; private bool flagBufTm = false;
private bool flagPurgeBuf = false; private bool flagSqNum = false;
private bool flagResvTms = false; private bool flagTrgOps = false;
private bool flagEntryId = false; private bool flagIntgPd = false;
private bool flagGI = false;
private event ReportHandler reportHandler = null; private bool flagPurgeBuf = false;
private object reportHandlerParameter; private bool flagResvTms = false;
private bool reportHandlerInstalled = false; private bool flagEntryId = false;
private event ReportHandler reportHandler = null;
private object reportHandlerParameter;
private bool reportHandlerInstalled = false;
private event InternalReportHandler internalHandler = null; private event InternalReportHandler internalHandler = null;
private void resetSendFlags () private void resetSendFlags()
{ {
flagRptId = false; flagRptId = false;
flagRptEna = false; flagRptEna = false;
flagResv = false; flagResv = false;
flagDataSetReference = false; flagDataSetReference = false;
flagConfRev = false; flagConfRev = false;
flagOptFlds = false; flagOptFlds = false;
flagBufTm = false; flagBufTm = false;
flagSqNum = false; flagSqNum = false;
flagTrgOps = false; flagTrgOps = false;
flagIntgPd = false; flagIntgPd = false;
flagGI = false; flagGI = false;
flagPurgeBuf = false; flagPurgeBuf = false;
flagResvTms = false; flagResvTms = false;
flagEntryId = false; flagEntryId = false;
} }
private Report report = null; private Report report = null;
private void internalReportHandler (IntPtr parameter, IntPtr report) private void internalReportHandler(IntPtr parameter, IntPtr report)
{ {
try { try
{
if (this.report == null)
this.report = new Report (report); if (this.report == null)
this.report = new Report(report);
if (reportHandler != null)
reportHandler(this.report, reportHandlerParameter); if (reportHandler != null)
reportHandler(this.report, reportHandlerParameter);
} catch (Exception e)
{ }
// older versions of mono 2.10 (for linux?) cause this exception catch (Exception e)
Console.WriteLine(e.Message); {
} // older versions of mono 2.10 (for linux?) cause this exception
} Console.WriteLine(e.Message);
}
internal ReportControlBlock (string objectReference, IedConnection iedConnection, IntPtr connection) }
{
self = ClientReportControlBlock_create (objectReference); internal ReportControlBlock(string objectReference, IedConnection iedConnection, IntPtr connection)
{
if (self != IntPtr.Zero) { self = ClientReportControlBlock_create(objectReference);
this.iedConnection = iedConnection;
this.objectReference = objectReference; if (self != IntPtr.Zero)
} {
} this.iedConnection = iedConnection;
this.objectReference = objectReference;
/// <summary> }
/// Releases all resource used by the <see cref="IEC61850.Client.ReportControlBlock"/> object. }
/// </summary>
/// <remarks>Call <see cref="Dispose"/> when you are finished using the <see cref="IEC61850.Client.ReportControlBlock"/>. The /// <summary>
/// <see cref="Dispose"/> method leaves the <see cref="IEC61850.Client.ReportControlBlock"/> in an unusable state. /// Releases all resource used by the <see cref="IEC61850.Client.ReportControlBlock"/> object.
/// After calling <see cref="Dispose"/>, you must release all references to the /// </summary>
/// <see cref="IEC61850.Client.ReportControlBlock"/> so the garbage collector can reclaim the memory that the /// <remarks>Call <see cref="Dispose"/> when you are finished using the <see cref="IEC61850.Client.ReportControlBlock"/>. The
/// <see cref="IEC61850.Client.ReportControlBlock"/> was occupying.</remarks> /// <see cref="Dispose"/> method leaves the <see cref="IEC61850.Client.ReportControlBlock"/> in an unusable state.
public void Dispose() /// After calling <see cref="Dispose"/>, you must release all references to the
{ /// <see cref="IEC61850.Client.ReportControlBlock"/> so the garbage collector can reclaim the memory that the
lock (this) { /// <see cref="IEC61850.Client.ReportControlBlock"/> was occupying.</remarks>
if (self != IntPtr.Zero) { public void Dispose()
{
iedConnection.UninstallReportHandler (objectReference); lock (this)
{
iedConnection.RemoveRCB (this); if (self != IntPtr.Zero)
{
ClientReportControlBlock_destroy (self);
iedConnection.UninstallReportHandler(objectReference);
self = IntPtr.Zero;
} iedConnection.RemoveRCB(this);
}
} ClientReportControlBlock_destroy(self);
~ReportControlBlock() self = IntPtr.Zero;
{ }
Dispose (); }
} }
public string GetObjectReference () ~ReportControlBlock()
{ {
return this.objectReference; Dispose();
} }
public string GetObjectReference()
{
return this.objectReference;
}
/// <summary> /// <summary>
/// Installs the report handler. /// Installs the report handler.
@ -267,40 +276,41 @@ namespace IEC61850
/// <param name='parameter'> /// <param name='parameter'>
/// parameter is passed to the handler when the handler is invoked. /// parameter is passed to the handler when the handler is invoked.
/// </param> /// </param>
public void InstallReportHandler (ReportHandler reportHandler, object parameter) public void InstallReportHandler(ReportHandler reportHandler, object parameter)
{ {
this.reportHandler = new ReportHandler(reportHandler); this.reportHandler = new ReportHandler(reportHandler);
this.reportHandlerParameter = parameter; this.reportHandlerParameter = parameter;
if (reportHandlerInstalled == false) { if (reportHandlerInstalled == false)
{
string reportId = this.GetRptId (); string reportId = this.GetRptId();
if (internalHandler == null) if (internalHandler == null)
{ {
internalHandler = new InternalReportHandler(internalReportHandler); internalHandler = new InternalReportHandler(internalReportHandler);
} }
iedConnection.InstallReportHandler (objectReference, reportId, internalHandler); iedConnection.InstallReportHandler(objectReference, reportId, internalHandler);
reportHandlerInstalled = true; reportHandlerInstalled = true;
} }
} }
/// <summary> /// <summary>
/// Read all RCB values from the server /// Read all RCB values from the server
/// </summary> /// </summary>
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception> /// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
public void GetRCBValues () public void GetRCBValues()
{ {
int error; int error;
iedConnection.GetRCBValues (out error, objectReference, self); iedConnection.GetRCBValues(out error, objectReference, self);
if (error != 0) if (error != 0)
throw new IedConnectionException ("getRCBValues service failed", error); throw new IedConnectionException("getRCBValues service failed", error);
} }
/// <summary> /// <summary>
/// Write changed RCB values to the server. /// Write changed RCB values to the server.
@ -310,10 +320,10 @@ namespace IEC61850
/// The RCB values are sent by a single MMS write request. /// The RCB values are sent by a single MMS write request.
/// </description> /// </description>
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception> /// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
public void SetRCBValues () public void SetRCBValues()
{ {
SetRCBValues (true); SetRCBValues(true);
} }
/// <summary> /// <summary>
/// Write changed RCB values to the server. /// Write changed RCB values to the server.
@ -325,7 +335,7 @@ namespace IEC61850
/// <param name='singleRequest'> /// <param name='singleRequest'>
/// If true the values are sent by single MMS write request. Otherwise the values are all sent by their own MMS write requests. /// If true the values are sent by single MMS write request. Otherwise the values are all sent by their own MMS write requests.
/// </param> /// </param>
public void SetRCBValues (bool singleRequest) public void SetRCBValues(bool singleRequest)
{ {
UInt32 parametersMask = 0; UInt32 parametersMask = 0;
@ -373,21 +383,23 @@ namespace IEC61850
int error; int error;
iedConnection.SetRCBValues (out error, self, parametersMask, singleRequest); iedConnection.SetRCBValues(out error, self, parametersMask, singleRequest);
resetSendFlags(); resetSendFlags();
if (error != 0) if (error != 0)
throw new IedConnectionException ("setRCBValues service failed", error); throw new IedConnectionException("setRCBValues service failed", error);
if (flagRptId) { if (flagRptId)
{
if (reportHandlerInstalled) { if (reportHandlerInstalled)
{
reportHandlerInstalled = false; reportHandlerInstalled = false;
InstallReportHandler(this.reportHandler, this.reportHandlerParameter); InstallReportHandler(this.reportHandler, this.reportHandlerParameter);
} }
} }
} }
/// <summary> /// <summary>
/// Determines whether this instance is a buffered or unbuffered RCB. /// Determines whether this instance is a buffered or unbuffered RCB.
@ -395,10 +407,10 @@ namespace IEC61850
/// <returns> /// <returns>
/// <c>true</c> if this instance is a buffered RCB; otherwise, <c>false</c>. /// <c>true</c> if this instance is a buffered RCB; otherwise, <c>false</c>.
/// </returns> /// </returns>
public bool IsBuffered () public bool IsBuffered()
{ {
return ClientReportControlBlock_isBuffered (self); return ClientReportControlBlock_isBuffered(self);
} }
/// <summary> /// <summary>
/// Gets the entry time of the RCB as ms time /// Gets the entry time of the RCB as ms time
@ -409,10 +421,10 @@ namespace IEC61850
/// <returns> /// <returns>
/// The entry time as ms timestamp /// The entry time as ms timestamp
/// </returns> /// </returns>
public UInt64 GetEntryTime () public UInt64 GetEntryTime()
{ {
return ClientReportControlBlock_getEntryTime (self); return ClientReportControlBlock_getEntryTime(self);
} }
/// <summary> /// <summary>
/// Gets the entry time of the RCB as DateTimeOffset /// Gets the entry time of the RCB as DateTimeOffset
@ -423,49 +435,50 @@ namespace IEC61850
/// <returns> /// <returns>
/// The entry time as DataTimeOffset /// The entry time as DataTimeOffset
/// </returns> /// </returns>
public DateTimeOffset GetEntryTimeAsDateTimeOffset () public DateTimeOffset GetEntryTimeAsDateTimeOffset()
{ {
UInt64 entryTime = GetEntryTime (); UInt64 entryTime = GetEntryTime();
DateTimeOffset retVal = new DateTimeOffset (1970, 1, 1, 0, 0, 0, TimeSpan.Zero); DateTimeOffset retVal = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
return retVal.AddMilliseconds (entryTime); return retVal.AddMilliseconds(entryTime);
} }
/// <summary> /// <summary>
/// Gets the entryID of RCB /// Gets the entryID of RCB
/// </summary> /// </summary>
/// Returns the EntryID of the last received GetRCBValues service response. /// Returns the EntryID of the last received GetRCBValues service response.
/// The EntryID is only present in buffered RCBs (BRCBs). /// The EntryID is only present in buffered RCBs (BRCBs).
/// ///
/// <returns>The entry ID</returns> /// <returns>The entry ID</returns>
public byte[] GetEntryID() public byte[] GetEntryID()
{ {
IntPtr entryIdRef = ClientReportControlBlock_getEntryId (self); IntPtr entryIdRef = ClientReportControlBlock_getEntryId(self);
if (entryIdRef == IntPtr.Zero) if (entryIdRef == IntPtr.Zero)
return null; return null;
else { else
MmsValue entryId = new MmsValue (entryIdRef); {
MmsValue entryId = new MmsValue(entryIdRef);
return entryId.getOctetString (); return entryId.getOctetString();
} }
} }
public void SetEntryID(byte[] entryId) public void SetEntryID(byte[] entryId)
{ {
flagEntryId = true; flagEntryId = true;
MmsValue entryID = MmsValue.NewOctetString (entryId.Length); MmsValue entryID = MmsValue.NewOctetString(entryId.Length);
entryID.setOctetString (entryId); entryID.setOctetString(entryId);
ClientReportControlBlock_setEntryId (self, entryID.valueReference); ClientReportControlBlock_setEntryId(self, entryID.valueReference);
} }
/// <summary> /// <summary>
@ -474,12 +487,12 @@ namespace IEC61850
/// <returns> /// <returns>
/// The data set reference. /// The data set reference.
/// </returns> /// </returns>
public string GetDataSetReference () public string GetDataSetReference()
{ {
IntPtr dataSetRefPtr = ClientReportControlBlock_getDataSetReference (self); IntPtr dataSetRefPtr = ClientReportControlBlock_getDataSetReference(self);
return Marshal.PtrToStringAnsi (dataSetRefPtr); return Marshal.PtrToStringAnsi(dataSetRefPtr);
} }
/// <summary> /// <summary>
/// Sets the data set reference. Use this method to select the associated data set for the RCB /// Sets the data set reference. Use this method to select the associated data set for the RCB
@ -487,12 +500,12 @@ namespace IEC61850
/// <returns> /// <returns>
/// The data set reference. /// The data set reference.
/// </returns> /// </returns>
public void SetDataSetReference (string dataSetReference) public void SetDataSetReference(string dataSetReference)
{ {
ClientReportControlBlock_setDataSetReference (self, dataSetReference); ClientReportControlBlock_setDataSetReference(self, dataSetReference);
flagDataSetReference = true; flagDataSetReference = true;
} }
/// <summary> /// <summary>
/// Gets the report identifier. /// Gets the report identifier.
@ -500,12 +513,12 @@ namespace IEC61850
/// <returns> /// <returns>
/// The report identifier. /// The report identifier.
/// </returns> /// </returns>
public string GetRptId () public string GetRptId()
{ {
IntPtr rptIdPtr = ClientReportControlBlock_getRptId (self); IntPtr rptIdPtr = ClientReportControlBlock_getRptId(self);
return Marshal.PtrToStringAnsi (rptIdPtr); return Marshal.PtrToStringAnsi(rptIdPtr);
} }
/// <summary> /// <summary>
/// Sets the RptId (report ID) of the RCB /// Sets the RptId (report ID) of the RCB
@ -513,7 +526,7 @@ namespace IEC61850
/// <param name='rptId'> /// <param name='rptId'>
/// The new RptId /// The new RptId
/// </param> /// </param>
public void SetRptId (string rptId) public void SetRptId(string rptId)
{ {
ClientReportControlBlock_setRptId(self, rptId); ClientReportControlBlock_setRptId(self, rptId);
flagRptId = true; flagRptId = true;
@ -525,10 +538,10 @@ namespace IEC61850
/// <returns> /// <returns>
/// true, if reporting is enabled, false otherwise /// true, if reporting is enabled, false otherwise
/// </returns> /// </returns>
public bool GetRptEna () public bool GetRptEna()
{ {
return ClientReportControlBlock_getRptEna (self); return ClientReportControlBlock_getRptEna(self);
} }
/// <summary> /// <summary>
/// Sets report enable flag. Use this to enable reporting /// Sets report enable flag. Use this to enable reporting
@ -536,17 +549,17 @@ namespace IEC61850
/// <param name='rptEna'> /// <param name='rptEna'>
/// true to enable reporting, false to disable /// true to enable reporting, false to disable
/// </param> /// </param>
public void SetRptEna (bool rptEna) public void SetRptEna(bool rptEna)
{ {
ClientReportControlBlock_setRptEna (self, rptEna); ClientReportControlBlock_setRptEna(self, rptEna);
flagRptEna = true; flagRptEna = true;
} }
/// <summary> /// <summary>
/// Get the purgeBuf flag of the report control block /// Get the purgeBuf flag of the report control block
/// </summary> /// </summary>
/// <returns>the prugeBuf value</returns> /// <returns>the prugeBuf value</returns>
public bool GetPurgeBuf () public bool GetPurgeBuf()
{ {
return ClientReportControlBlock_getPurgeBuf(self); return ClientReportControlBlock_getPurgeBuf(self);
} }
@ -556,7 +569,7 @@ namespace IEC61850
/// </summary> /// </summary>
/// <description>This is only for buffered RCBs. If set to true the report buffer of a buffered RCB will be cleaned.</description> /// <description>This is only for buffered RCBs. If set to true the report buffer of a buffered RCB will be cleaned.</description>
/// <param name="purgeBuf">set to true to flush report buffer</param> /// <param name="purgeBuf">set to true to flush report buffer</param>
public void SetPurgeBuf (bool purgeBuf) public void SetPurgeBuf(bool purgeBuf)
{ {
ClientReportControlBlock_setPurgeBuf(self, purgeBuf); ClientReportControlBlock_setPurgeBuf(self, purgeBuf);
flagPurgeBuf = true; flagPurgeBuf = true;
@ -569,9 +582,9 @@ namespace IEC61850
/// The buffer time in ms. /// The buffer time in ms.
/// </returns> /// </returns>
public UInt32 GetBufTm() public UInt32 GetBufTm()
{ {
return ClientReportControlBlock_getBufTm (self); return ClientReportControlBlock_getBufTm(self);
} }
/// <summary> /// <summary>
/// Sets the buffer time. /// Sets the buffer time.
@ -579,12 +592,12 @@ namespace IEC61850
/// <param name='bufTm'> /// <param name='bufTm'>
/// Buffer time is ms. /// Buffer time is ms.
/// </param> /// </param>
public void SetBufTm (UInt32 bufTm) public void SetBufTm(UInt32 bufTm)
{ {
ClientReportControlBlock_setBufTm (self, bufTm); ClientReportControlBlock_setBufTm(self, bufTm);
flagBufTm = true; flagBufTm = true;
} }
/// <summary> /// <summary>
/// Gets the GI flag /// Gets the GI flag
@ -592,10 +605,10 @@ namespace IEC61850
/// <returns> /// <returns>
/// true, if GI flag is set /// true, if GI flag is set
/// </returns> /// </returns>
public bool GetGI () public bool GetGI()
{ {
return ClientReportControlBlock_getGI (self); return ClientReportControlBlock_getGI(self);
} }
/// <summary> /// <summary>
/// Sets the GI flag. Use this to trigger a GI (general interrogation) command. /// Sets the GI flag. Use this to trigger a GI (general interrogation) command.
@ -603,11 +616,11 @@ namespace IEC61850
/// <param name='GI'> /// <param name='GI'>
/// request general interrogation of true /// request general interrogation of true
/// </param> /// </param>
public void SetGI (bool GI) public void SetGI(bool GI)
{ {
ClientReportControlBlock_setGI (self, GI); ClientReportControlBlock_setGI(self, GI);
flagGI = true; flagGI = true;
} }
/// <summary> /// <summary>
/// Check if RCB is reserved by a client /// Check if RCB is reserved by a client
@ -615,10 +628,10 @@ namespace IEC61850
/// <returns> /// <returns>
/// true, the RCB is reserver by a client /// true, the RCB is reserver by a client
/// </returns> /// </returns>
public bool GetResv () public bool GetResv()
{ {
return ClientReportControlBlock_getResv (self); return ClientReportControlBlock_getResv(self);
} }
/// <summary> /// <summary>
/// Gets the configuration revision of the RCB /// Gets the configuration revision of the RCB
@ -626,9 +639,9 @@ namespace IEC61850
/// <returns> /// <returns>
/// The conf rev. /// The conf rev.
/// </returns> /// </returns>
public UInt32 GetConfRev () public UInt32 GetConfRev()
{ {
return ClientReportControlBlock_getConfRev (self); return ClientReportControlBlock_getConfRev(self);
} }
/// <summary> /// <summary>
@ -637,11 +650,11 @@ namespace IEC61850
/// <param name='resv'> /// <param name='resv'>
/// true: reserver this RCB for exclusive use /// true: reserver this RCB for exclusive use
/// </param> /// </param>
public void SetResv (bool resv) public void SetResv(bool resv)
{ {
ClientReportControlBlock_setResv (self, resv); ClientReportControlBlock_setResv(self, resv);
flagResv = true; flagResv = true;
} }
/// <summary> /// <summary>
/// Gets the trigger options of the RCB /// Gets the trigger options of the RCB
@ -650,9 +663,9 @@ namespace IEC61850
/// trigger options /// trigger options
/// </returns> /// </returns>
public TriggerOptions GetTrgOps() public TriggerOptions GetTrgOps()
{ {
return (TriggerOptions) ClientReportControlBlock_getTrgOps (self); return (TriggerOptions)ClientReportControlBlock_getTrgOps(self);
} }
/// <summary> /// <summary>
/// Sets the trigger options of the RCB. /// Sets the trigger options of the RCB.
@ -661,11 +674,11 @@ namespace IEC61850
/// trigger options /// trigger options
/// </param> /// </param>
public void SetTrgOps(TriggerOptions trgOps) public void SetTrgOps(TriggerOptions trgOps)
{ {
ClientReportControlBlock_setTrgOps (self, (int) trgOps); ClientReportControlBlock_setTrgOps(self, (int)trgOps);
flagTrgOps = true; flagTrgOps = true;
} }
/// <summary> /// <summary>
/// Gets the integrity period /// Gets the integrity period
@ -673,10 +686,10 @@ namespace IEC61850
/// <returns> /// <returns>
/// integrity period in ms /// integrity period in ms
/// </returns> /// </returns>
public UInt32 GetIntgPd () public UInt32 GetIntgPd()
{ {
return ClientReportControlBlock_getIntgPd (self); return ClientReportControlBlock_getIntgPd(self);
} }
/// <summary> /// <summary>
/// Sets the integrity period /// Sets the integrity period
@ -684,11 +697,11 @@ namespace IEC61850
/// <param name='intgPd'> /// <param name='intgPd'>
/// integrity period in ms /// integrity period in ms
/// </param> /// </param>
public void SetIntgPd (UInt32 intgPd) public void SetIntgPd(UInt32 intgPd)
{ {
ClientReportControlBlock_setIntgPd (self, intgPd); ClientReportControlBlock_setIntgPd(self, intgPd);
flagIntgPd = true; flagIntgPd = true;
} }
/// <summary> /// <summary>
/// Gets the option fields. /// Gets the option fields.
@ -697,9 +710,9 @@ namespace IEC61850
/// The option fields /// The option fields
/// </returns> /// </returns>
public ReportOptions GetOptFlds() public ReportOptions GetOptFlds()
{ {
return (ReportOptions) ClientReportControlBlock_getOptFlds (self); return (ReportOptions)ClientReportControlBlock_getOptFlds(self);
} }
/// <summary> /// <summary>
/// Sets the option field. Used to enable or disable optional report elements /// Sets the option field. Used to enable or disable optional report elements
@ -708,38 +721,47 @@ namespace IEC61850
/// Option field. /// Option field.
/// </param> /// </param>
public void SetOptFlds(ReportOptions optFlds) public void SetOptFlds(ReportOptions optFlds)
{ {
ClientReportControlBlock_setOptFlds (self, (int)optFlds); ClientReportControlBlock_setOptFlds(self, (int)optFlds);
flagOptFlds = true; flagOptFlds = true;
} }
/// <summary> /// <summary>
/// Gets the ResvTms (reservation time) value /// Check if the report control block has the "ResvTms" attribute.
/// </summary> /// </summary>
/// <remarks> /// <returns><c>true</c>, if ResvTms is available, <c>false</c> otherwise.</returns>
/// Only for BRCB. public bool HasResvTms()
/// Value of -1 indicate the BRCB is exclusively reserved for a set of client based upon configuration. {
/// Value of 0 means that the BRCB is not reserved. return ClientReportControlBlock_hasResvTms(self);
/// Positive value indicates that the BRCB is reserved dynamically and the value is the number of }
/// seconds for reservation after association loss.
/// </remarks> /// <summary>
/// <returns>The reservation time</returns> /// Gets the ResvTms (reservation time) value
public Int16 GetResvTms() /// </summary>
{ /// <remarks>
return ClientReportControlBlock_getResvTms (self); /// Only for BRCB.
} /// Value of -1 indicate the BRCB is exclusively reserved for a set of client based upon configuration.
/// Value of 0 means that the BRCB is not reserved.
/// <summary> /// Positive value indicates that the BRCB is reserved dynamically and the value is the number of
/// Sets the ResvTms (reservation time) value /// seconds for reservation after association loss.
/// </summary> /// </remarks>
/// <param name="resvTms">the reservation time value</param> /// <returns>The reservation time</returns>
public void SetResvTms(Int16 resvTms) public Int16 GetResvTms()
{ {
ClientReportControlBlock_setResvTms (self, resvTms); return ClientReportControlBlock_getResvTms(self);
}
flagResvTms = true;
} /// <summary>
/// Sets the ResvTms (reservation time) value
/// </summary>
/// <param name="resvTms">the reservation time value</param>
public void SetResvTms(Int16 resvTms)
{
ClientReportControlBlock_setResvTms(self, resvTms);
flagResvTms = true;
}
/// <summary> /// <summary>
/// Gets the current owner of the RCB /// Gets the current owner of the RCB
@ -758,7 +780,6 @@ namespace IEC61850
else else
return null; return null;
} }
} }
}
}
} }

Loading…
Cancel
Save