- .NET API: Added support for SVCB handling

pull/143/head
Michael Zillgith 8 years ago
parent ac3a07c5a4
commit 81e18261bc

@ -46,6 +46,7 @@
<Compile Include="IEC61850ServerAPI.cs" /> <Compile Include="IEC61850ServerAPI.cs" />
<Compile Include="IEC61850CommonAPI.cs" /> <Compile Include="IEC61850CommonAPI.cs" />
<Compile Include="TLS.cs" /> <Compile Include="TLS.cs" />
<Compile Include="SampledValuesControlBlock.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project> </Project>

@ -85,6 +85,29 @@ namespace IEC61850
GI = 16 GI = 16
} }
/// <summary>
/// SmpMod values
/// </summary>
public enum SmpMod {
SAMPLES_PER_PERIOD = 0,
SAMPLES_PER_SECOND = 1,
SECONDS_PER_SAMPLE = 2
}
/// <summary>
/// Values for Sampled Values (SV) OptFlds
/// </summary>
[Flags]
public enum SVOptions {
NONE = 0,
REFRESH_TIME = 1,
SAMPLE_SYNC = 2,
SAMPLE_RATE = 4,
DATA_SET = 8,
SECURITY = 16,
ALL = 31
}
[Flags] [Flags]
public enum ReportOptions { public enum ReportOptions {
NONE = 0, NONE = 0,

@ -46,6 +46,19 @@ namespace IEC61850
} }
/// <summary>
/// Creates a new SampledValuesControlBlock instance.
/// </summary>
/// <description>>
/// This function will also read the SVCB values from the server.
/// </description>
/// <returns>The new SVCB instamce</returns>
/// <param name="svcbObjectReference">The object reference of the SVCB</param>
public SampledValuesControlBlock GetSvControlBlock (string svcbObjectReference)
{
return new SampledValuesControlBlock (connection, svcbObjectReference);
}
public ReportControlBlock GetReportControlBlock (string rcbObjectReference) public ReportControlBlock GetReportControlBlock (string rcbObjectReference)
{ {
var newRCB = new ReportControlBlock (rcbObjectReference, this, connection); var newRCB = new ReportControlBlock (rcbObjectReference, this, connection);

@ -115,16 +115,16 @@ setBooleanVariable(ClientSVControlBlock self, const char* varName, bool value)
} }
bool bool
ClientSVControlBlock_setSvEna(ClientSVControlBlock self, bool svEna) ClientSVControlBlock_setSvEna(ClientSVControlBlock self, bool value)
{ {
return setBooleanVariable(self, "SvEna", svEna); return setBooleanVariable(self, "SvEna", value);
} }
bool bool
ClientSVControlBlock_setResv(ClientSVControlBlock self, bool svEna) ClientSVControlBlock_setResv(ClientSVControlBlock self, bool value)
{ {
if (self->isMulticast == false) if (self->isMulticast == false)
return setBooleanVariable(self, "SvEna", svEna); return setBooleanVariable(self, "SvEna", value);
else else
return false; return false;
} }

@ -344,6 +344,12 @@ IedConnection_getMmsConnection(IedConnection self);
/** SV ASDU contains attribute Security */ /** SV ASDU contains attribute Security */
#define IEC61850_SV_OPT_SECURITY 16 #define IEC61850_SV_OPT_SECURITY 16
#define IEC61850_SV_SMPMOD_SAMPLES_PER_PERIOD 0
#define IEC61850_SV_SMPMOD_SAMPLES_PER_SECOND 1
#define IEC61850_SV_SMPMOD_SECONDS_PER_SAMPLE 2
/** an opaque handle to the instance data of a ClientSVControlBlock object */ /** an opaque handle to the instance data of a ClientSVControlBlock object */
typedef struct sClientSVControlBlock* ClientSVControlBlock; typedef struct sClientSVControlBlock* ClientSVControlBlock;
@ -385,13 +391,13 @@ ClientSVControlBlock_getLastComError(ClientSVControlBlock self);
bool bool
ClientSVControlBlock_setSvEna(ClientSVControlBlock self, bool svEna); ClientSVControlBlock_setSvEna(ClientSVControlBlock self, bool value);
bool bool
ClientSVControlBlock_getSvEna(ClientSVControlBlock self); ClientSVControlBlock_getSvEna(ClientSVControlBlock self);
bool bool
ClientSVControlBlock_setResv(ClientSVControlBlock self, bool svEna); ClientSVControlBlock_setResv(ClientSVControlBlock self, bool value);
bool bool
ClientSVControlBlock_getResv(ClientSVControlBlock self); ClientSVControlBlock_getResv(ClientSVControlBlock self);

Loading…
Cancel
Save