Skip to content

Commit 6872d89

Browse files
committed
- CS104 Slave: Add function to get number of ASDU in queue
1 parent ab9c140 commit 6872d89

File tree

5 files changed

+350
-68
lines changed

5 files changed

+350
-68
lines changed

examples/cs104-redundancy-server/Program.cs

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,11 @@
1-
// /*
2-
// * Copyright 2016, 2017 MZ Automation GmbH
3-
// *
4-
// * This file is part of lib60870.NET
5-
// *
6-
// * lib60870.NET is free software: you can redistribute it and/or modify
7-
// * it under the terms of the GNU General Public License as published by
8-
// * the Free Software Foundation, either version 3 of the License, or
9-
// * (at your option) any later version.
10-
// *
11-
// * lib60870.NET is distributed in the hope that it will be useful,
12-
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
// * GNU General Public License for more details.
15-
// *
16-
// * You should have received a copy of the GNU General Public License
17-
// * along with lib60870.NET. If not, see <http://www.gnu.org/licenses/>.
18-
// *
19-
// * See COPYING file for the complete license text.
20-
// */
21-
//
22-
//
23-
using System;
1+
using System;
2+
using System.Net;
3+
using System.Net.Sockets;
4+
using System.Threading;
245

256
using lib60870;
267
using lib60870.CS101;
278
using lib60870.CS104;
28-
using System.Net;
29-
using System.Threading;
309

3110
namespace cs104_redundancy_server
3211
{

lib60870.NET.sln

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.28307.757
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.9.34714.143
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lib60870", "lib60870\lib60870.csproj", "{F604286A-1AFC-4355-8C2C-A998CFCEE979}"
77
EndProject
@@ -43,6 +43,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cs104-redundancy-server", "
4343
EndProject
4444
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cs104-client-file-upload", "examples\cs104-client-file-upload\cs104-client-file-upload.csproj", "{8DAC3BE2-E1C9-4E12-BF11-70FFBAE4C888}"
4545
EndProject
46+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cs104-server4", "examples\cs104-server4\cs104-server4.csproj", "{7A8DD7FA-3248-4DA4-8A6E-3BF673D2C6FE}"
47+
EndProject
48+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cs104-server5", "examples\cs104-server5\cs104-server5.csproj", "{E510D4EA-5C1A-4343-8BA7-4E4C941B2CB8}"
49+
EndProject
4650
Global
4751
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4852
Debug|Any CPU = Debug|Any CPU
@@ -173,6 +177,22 @@ Global
173177
{8DAC3BE2-E1C9-4E12-BF11-70FFBAE4C888}.Release|Any CPU.ActiveCfg = Release|x86
174178
{8DAC3BE2-E1C9-4E12-BF11-70FFBAE4C888}.Release|x86.ActiveCfg = Release|x86
175179
{8DAC3BE2-E1C9-4E12-BF11-70FFBAE4C888}.Release|x86.Build.0 = Release|x86
180+
{7A8DD7FA-3248-4DA4-8A6E-3BF673D2C6FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
181+
{7A8DD7FA-3248-4DA4-8A6E-3BF673D2C6FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
182+
{7A8DD7FA-3248-4DA4-8A6E-3BF673D2C6FE}.Debug|x86.ActiveCfg = Debug|Any CPU
183+
{7A8DD7FA-3248-4DA4-8A6E-3BF673D2C6FE}.Debug|x86.Build.0 = Debug|Any CPU
184+
{7A8DD7FA-3248-4DA4-8A6E-3BF673D2C6FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
185+
{7A8DD7FA-3248-4DA4-8A6E-3BF673D2C6FE}.Release|Any CPU.Build.0 = Release|Any CPU
186+
{7A8DD7FA-3248-4DA4-8A6E-3BF673D2C6FE}.Release|x86.ActiveCfg = Release|Any CPU
187+
{7A8DD7FA-3248-4DA4-8A6E-3BF673D2C6FE}.Release|x86.Build.0 = Release|Any CPU
188+
{E510D4EA-5C1A-4343-8BA7-4E4C941B2CB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
189+
{E510D4EA-5C1A-4343-8BA7-4E4C941B2CB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
190+
{E510D4EA-5C1A-4343-8BA7-4E4C941B2CB8}.Debug|x86.ActiveCfg = Debug|Any CPU
191+
{E510D4EA-5C1A-4343-8BA7-4E4C941B2CB8}.Debug|x86.Build.0 = Debug|Any CPU
192+
{E510D4EA-5C1A-4343-8BA7-4E4C941B2CB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
193+
{E510D4EA-5C1A-4343-8BA7-4E4C941B2CB8}.Release|Any CPU.Build.0 = Release|Any CPU
194+
{E510D4EA-5C1A-4343-8BA7-4E4C941B2CB8}.Release|x86.ActiveCfg = Release|Any CPU
195+
{E510D4EA-5C1A-4343-8BA7-4E4C941B2CB8}.Release|x86.Build.0 = Release|Any CPU
176196
EndGlobalSection
177197
GlobalSection(SolutionProperties) = preSolution
178198
HideSolutionNode = FALSE

lib60870/CS101/ASDU.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,10 @@ internal void Encode(Frame frame, ApplicationLayerParameters parameters)
227227
frame.AppendBytes(payload);
228228
else
229229
{
230-
231230
bool isFirst = true;
232231

233232
foreach (InformationObject io in informationObjects)
234233
{
235-
236234
if (isFirst)
237235
{
238236
io.Encode(frame, parameters, false);
@@ -245,7 +243,6 @@ internal void Encode(Frame frame, ApplicationLayerParameters parameters)
245243
else
246244
io.Encode(frame, parameters, false);
247245
}
248-
249246
}
250247
}
251248
}

0 commit comments

Comments
 (0)