From cd81f9b13dd15f33a54a6da8b505c2f12df09341 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Wed, 24 Oct 2018 18:28:55 +0200 Subject: [PATCH] - .NET API: Added ReportControlBlock.GetOwner method (#79) --- dotnet/IEC61850forCSharp/ReportControlBlock.cs | 13 +++++++++++++ dotnet/reporting/ReportingExample.cs | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/dotnet/IEC61850forCSharp/ReportControlBlock.cs b/dotnet/IEC61850forCSharp/ReportControlBlock.cs index 9d414b87..0abae209 100644 --- a/dotnet/IEC61850forCSharp/ReportControlBlock.cs +++ b/dotnet/IEC61850forCSharp/ReportControlBlock.cs @@ -738,6 +738,19 @@ namespace IEC61850 flagResvTms = true; } + + /// + /// Gets the current owner of the RCB + /// + /// The owner information + public byte[] GetOwner() + { + IntPtr mmsValuePtr = ClientReportControlBlock_getOwner(self); + + MmsValue octetStringVal = new MmsValue(mmsValuePtr); + + return octetStringVal.getOctetString(); + } } } diff --git a/dotnet/reporting/ReportingExample.cs b/dotnet/reporting/ReportingExample.cs index 4edb29b8..3166745a 100644 --- a/dotnet/reporting/ReportingExample.cs +++ b/dotnet/reporting/ReportingExample.cs @@ -104,6 +104,10 @@ namespace reporting rcb2.SetRCBValues(); + rcb2.GetRCBValues(); + + Console.WriteLine("RCB: " + rcbReference2 + " Owner: " + BitConverter.ToString(rcb2.GetOwner())); + rcb3.GetRCBValues(); if (rcb3.IsBuffered())