├── .github
├── FUNDING.yml
└── workflows
│ ├── codeql.yml
│ └── dotnet.yml
├── .gitignore
├── BACnet.csproj
├── BACnet.csproj.DotSettings
├── BACnet.sln
├── BACnet.sln.DotSettings
├── BACnetClient.cs
├── BacnetAsyncResult.cs
├── Base
├── BaCnetCalendarEntry.cs
├── BacnetAbortReason.cs
├── BacnetAddress.cs
├── BacnetAddressTypes.cs
├── BacnetApplicationTags.cs
├── BacnetBinaryPv.cs
├── BacnetBitString.cs
├── BacnetBvlcFunctions.cs
├── BacnetBvlcResults.cs
├── BacnetBvlcV6Functions.cs
├── BacnetBvlcV6Results.cs
├── BacnetCOVSubscription.cs
├── BacnetCharacterStringEncodings.cs
├── BacnetConfirmedServices.cs
├── BacnetDate.cs
├── BacnetDateRange.cs
├── BacnetDeviceObjectPropertyReference.cs
├── BacnetDeviceStatus.cs
├── BacnetError.cs
├── BacnetErrorClasses.cs
├── BacnetErrorCodes.cs
├── BacnetEventNotificationData.cs
├── BacnetGenericTime.cs
├── BacnetGetEventInformationData.cs
├── BacnetLogRecord.cs
├── BacnetMaxAdpu.cs
├── BacnetMaxSegments.cs
├── BacnetMstpFrameTypes.cs
├── BacnetNetworkMessageTypes.cs
├── BacnetNodeTypes.cs
├── BacnetNpduControls.cs
├── BacnetObjectDescription.cs
├── BacnetObjectId.cs
├── BacnetObjectTypes.cs
├── BacnetPduTypes.cs
├── BacnetPolarity.cs
├── BacnetProgramError.cs
├── BacnetProgramRequest.cs
├── BacnetProgramState.cs
├── BacnetPropertyIds.cs
├── BacnetPropertyReference.cs
├── BacnetPropertyState.cs
├── BacnetPropertyValue.cs
├── BacnetPtpDisconnectReasons.cs
├── BacnetPtpFrameTypes.cs
├── BacnetReadAccessResult.cs
├── BacnetReadAccessSpecification.cs
├── BacnetReadRangeRequestTypes.cs
├── BacnetReinitializedStates.cs
├── BacnetRejectReason.cs
├── BacnetReliability.cs
├── BacnetRestartReason.cs
├── BacnetResultFlags.cs
├── BacnetSegmentations.cs
├── BacnetServicesSupported.cs
├── BacnetStatusFlags.cs
├── BacnetTimestampTags.cs
├── BacnetTrendLogValueType.cs
├── BacnetUnconfirmedServices.cs
├── BacnetUnitsId.cs
├── BacnetValue.cs
├── BacnetWritePriority.cs
├── BacnetweekNDay.cs
├── DeviceReportingRecipient.cs
└── Enums
│ ├── BacnetBackupState.cs
│ ├── BacnetCOVTypes.cs
│ ├── BacnetEventEnable.cs
│ ├── BacnetEventStates.cs
│ ├── BacnetEventTypes.cs
│ ├── BacnetFileAccessMethod.cs
│ ├── BacnetLifeSafetyModes.cs
│ ├── BacnetLifeSafetyOperations.cs
│ ├── BacnetLifeSafetyStates.cs
│ ├── BacnetLimitEnable.cs
│ └── BacnetNotifyTypes.cs
├── GlobalUsings.cs
├── Helpers
└── BacnetValuesExtensions.cs
├── MIT_license.txt
├── README.md
├── Serialize
├── APDU.cs
├── ASN1.cs
├── BVLC.cs
├── EncodeBuffer.cs
├── EncodeResult.cs
├── MSTP.cs
├── NPDU.cs
├── PTP.cs
└── Services.cs
├── Storage
├── DeviceStorage.cs
├── Object.cs
└── Property.cs
├── Transport
├── BVLCV6.cs
├── BacnetIpUdpProtocolTransport.cs
├── BacnetIpV6UdpProtocolTransport.cs
├── BacnetMstpProtocolTransport.cs
├── BacnetPipeTransport.cs
├── BacnetPtpProtocolTransport.cs
├── BacnetSerialPortTransport.cs
├── BacnetTransportBase.cs
├── BacnetTransportEthernet.cs
├── IBacnetSerialTransport.cs
└── IBacnetTransport.cs
└── logo.png
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [gralin]
4 |
--------------------------------------------------------------------------------
/.github/workflows/codeql.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | #
7 | # ******** NOTE ********
8 | # We have attempted to detect the languages in your repository. Please check
9 | # the `language` matrix defined below to confirm you have the correct set of
10 | # supported CodeQL languages.
11 | #
12 | name: "CodeQL"
13 |
14 | on:
15 | push:
16 | branches: [ "master" ]
17 | pull_request:
18 | # The branches below must be a subset of the branches above
19 | branches: [ "master" ]
20 | schedule:
21 | - cron: '41 18 * * 5'
22 |
23 | jobs:
24 | analyze:
25 | name: Analyze
26 | runs-on: ubuntu-latest
27 | permissions:
28 | actions: read
29 | contents: read
30 | security-events: write
31 |
32 | strategy:
33 | fail-fast: false
34 | matrix:
35 | language: [ 'csharp' ]
36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37 | # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38 |
39 | steps:
40 | - name: Checkout repository
41 | uses: actions/checkout@v3
42 |
43 | # Initializes the CodeQL tools for scanning.
44 | - name: Initialize CodeQL
45 | uses: github/codeql-action/init@v2
46 | with:
47 | languages: ${{ matrix.language }}
48 | # If you wish to specify custom queries, you can do so here or in a config file.
49 | # By default, queries listed here will override any specified in a config file.
50 | # Prefix the list here with "+" to use these queries and those in the config file.
51 |
52 | # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53 | # queries: security-extended,security-and-quality
54 |
55 |
56 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57 | # If this step fails, then you should remove it and run the build manually (see below)
58 | - name: Autobuild
59 | uses: github/codeql-action/autobuild@v2
60 |
61 | # ℹ️ Command-line programs to run using the OS shell.
62 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63 |
64 | # If the Autobuild fails above, remove it and uncomment the following three lines.
65 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66 |
67 | # - run: |
68 | # echo "Run, Build Application using script"
69 | # ./location_of_script_within_repo/buildscript.sh
70 |
71 | - name: Perform CodeQL Analysis
72 | uses: github/codeql-action/analyze@v2
73 |
--------------------------------------------------------------------------------
/.github/workflows/dotnet.yml:
--------------------------------------------------------------------------------
1 | name: .NET
2 |
3 | on:
4 | push:
5 | branches: [ "master" ]
6 | pull_request:
7 | branches: [ "master" ]
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - uses: actions/checkout@v3
16 | - name: Setup .NET
17 | uses: actions/setup-dotnet@v2
18 | with:
19 | dotnet-version: 6.0.x
20 | - name: Restore dependencies
21 | run: dotnet restore
22 | - name: Build
23 | run: dotnet build --no-restore
24 | - name: Test
25 | run: dotnet test --no-build --verbosity normal
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 | *.VC.VC.opendb
85 |
86 | # Visual Studio profiler
87 | *.psess
88 | *.vsp
89 | *.vspx
90 | *.sap
91 |
92 | # TFS 2012 Local Workspace
93 | $tf/
94 |
95 | # Guidance Automation Toolkit
96 | *.gpState
97 |
98 | # ReSharper is a .NET coding add-in
99 | _ReSharper*/
100 | *.[Rr]e[Ss]harper
101 | *.DotSettings.user
102 |
103 | # JustCode is a .NET coding add-in
104 | .JustCode
105 |
106 | # TeamCity is a build add-in
107 | _TeamCity*
108 |
109 | # DotCover is a Code Coverage Tool
110 | *.dotCover
111 |
112 | # NCrunch
113 | _NCrunch_*
114 | .*crunch*.local.xml
115 | nCrunchTemp_*
116 |
117 | # MightyMoose
118 | *.mm.*
119 | AutoTest.Net/
120 |
121 | # Web workbench (sass)
122 | .sass-cache/
123 |
124 | # Installshield output folder
125 | [Ee]xpress/
126 |
127 | # DocProject is a documentation generator add-in
128 | DocProject/buildhelp/
129 | DocProject/Help/*.HxT
130 | DocProject/Help/*.HxC
131 | DocProject/Help/*.hhc
132 | DocProject/Help/*.hhk
133 | DocProject/Help/*.hhp
134 | DocProject/Help/Html2
135 | DocProject/Help/html
136 |
137 | # Click-Once directory
138 | publish/
139 |
140 | # Publish Web Output
141 | *.[Pp]ublish.xml
142 | *.azurePubxml
143 | # TODO: Comment the next line if you want to checkin your web deploy settings
144 | # but database connection strings (with potential passwords) will be unencrypted
145 | *.pubxml
146 | *.publishproj
147 |
148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
149 | # checkin your Azure Web App publish settings, but sensitive information contained
150 | # in these scripts will be unencrypted
151 | PublishScripts/
152 |
153 | # NuGet Packages
154 | *.nupkg
155 | # The packages folder can be ignored because of Package Restore
156 | **/packages/*
157 | # except build/, which is used as an MSBuild target.
158 | !**/packages/build/
159 | # Uncomment if necessary however generally it will be regenerated when needed
160 | #!**/packages/repositories.config
161 | # NuGet v3's project.json files produces more ignoreable files
162 | *.nuget.props
163 | *.nuget.targets
164 |
165 | # Microsoft Azure Build Output
166 | csx/
167 | *.build.csdef
168 |
169 | # Microsoft Azure Emulator
170 | ecf/
171 | rcf/
172 |
173 | # Windows Store app package directories and files
174 | AppPackages/
175 | BundleArtifacts/
176 | Package.StoreAssociation.xml
177 | _pkginfo.txt
178 |
179 | # Visual Studio cache files
180 | # files ending in .cache can be ignored
181 | *.[Cc]ache
182 | # but keep track of directories ending in .cache
183 | !*.[Cc]ache/
184 |
185 | # Others
186 | ClientBin/
187 | ~$*
188 | *~
189 | *.dbmdl
190 | *.dbproj.schemaview
191 | *.pfx
192 | *.publishsettings
193 | node_modules/
194 | orleans.codegen.cs
195 |
196 | # Since there are multiple workflows, uncomment next line to ignore bower_components
197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
198 | #bower_components/
199 |
200 | # RIA/Silverlight projects
201 | Generated_Code/
202 |
203 | # Backup & report files from converting an old project file
204 | # to a newer Visual Studio version. Backup files are not needed,
205 | # because we have git ;-)
206 | _UpgradeReport_Files/
207 | Backup*/
208 | UpgradeLog*.XML
209 | UpgradeLog*.htm
210 |
211 | # SQL Server files
212 | *.mdf
213 | *.ldf
214 |
215 | # Business Intelligence projects
216 | *.rdl.data
217 | *.bim.layout
218 | *.bim_*.settings
219 |
220 | # Microsoft Fakes
221 | FakesAssemblies/
222 |
223 | # GhostDoc plugin setting file
224 | *.GhostDoc.xml
225 |
226 | # Node.js Tools for Visual Studio
227 | .ntvs_analysis.dat
228 |
229 | # Visual Studio 6 build log
230 | *.plg
231 |
232 | # Visual Studio 6 workspace options file
233 | *.opt
234 |
235 | # Visual Studio LightSwitch build output
236 | **/*.HTMLClient/GeneratedArtifacts
237 | **/*.DesktopClient/GeneratedArtifacts
238 | **/*.DesktopClient/ModelManifest.xml
239 | **/*.Server/GeneratedArtifacts
240 | **/*.Server/ModelManifest.xml
241 | _Pvt_Extensions
242 |
243 | # Paket dependency manager
244 | .paket/paket.exe
245 | paket-files/
246 |
247 | # FAKE - F# Make
248 | .fake/
249 |
250 | # JetBrains Rider
251 | .idea/
252 | *.sln.iml
--------------------------------------------------------------------------------
/BACnet.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | latest
4 | net48;netstandard2.0
5 | Ela-compil sp. z o. o.
6 | Ela-compil and contributors
7 | BACnet
8 | Copyright (c) Ela-compil sp. z o. o.
9 | BACnet protocol library for .NET
10 | Library
11 | true
12 | MIT
13 | System.IO.BACnet
14 | true
15 | bacnet;btl;automation
16 | git
17 | https://github.com/ela-compil/BACnet
18 | logo.png
19 | https://raw.githubusercontent.com/ela-compil/BACnet/master/logo.png
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/BACnet.csproj.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | True
3 | True
4 | True
5 | NEVER
6 | True
7 | <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb"><ExtraRule Prefix="_" Suffix="" Style="aaBb" /></Policy>
8 | True
9 | True
10 | True
11 | True
12 | True
13 | True
14 | True
15 | True
16 | True
17 |
--------------------------------------------------------------------------------
/BACnet.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.1.31911.260
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BACnet", "BACnet.csproj", "{66832876-01FC-4B7C-8D92-54195773FABF}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {66832876-01FC-4B7C-8D92-54195773FABF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {66832876-01FC-4B7C-8D92-54195773FABF}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {66832876-01FC-4B7C-8D92-54195773FABF}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {66832876-01FC-4B7C-8D92-54195773FABF}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {4BD775C7-0626-4B2B-969B-285F36768D4D}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/BACnet.sln.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | APDU
3 | ASN
4 | BBMD
5 | BVLC
6 | COV
7 | FDR
8 | IP
9 | IPV
10 | MSTP
11 | NPDU
12 | PTP
13 | VMAC
14 | <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" />
15 | <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" />
16 |
--------------------------------------------------------------------------------
/BacnetAsyncResult.cs:
--------------------------------------------------------------------------------
1 | namespace System.IO.BACnet;
2 |
3 | public class BacnetAsyncResult : IAsyncResult, IDisposable
4 | {
5 | private BacnetClient _comm;
6 | private readonly byte _waitInvokeId;
7 | private Exception _error;
8 | private readonly byte[] _transmitBuffer;
9 | private readonly int _transmitLength;
10 | private readonly bool _waitForTransmit;
11 | private readonly int _transmitTimeout;
12 | private ManualResetEvent _waitHandle;
13 | private readonly BacnetAddress _address;
14 |
15 | public bool Segmented { get; private set; }
16 | public byte[] Result { get; private set; }
17 | public object AsyncState { get; set; }
18 | public bool CompletedSynchronously { get; private set; }
19 | public WaitHandle AsyncWaitHandle => _waitHandle;
20 | public bool IsCompleted => _waitHandle.WaitOne(0);
21 | public BacnetAddress Address => _address;
22 |
23 | public Exception Error
24 | {
25 | get => _error;
26 | set
27 | {
28 | _error = value;
29 | CompletedSynchronously = true;
30 | _waitHandle.Set();
31 | }
32 | }
33 |
34 | public BacnetAsyncResult(BacnetClient comm, BacnetAddress adr, byte invokeId, byte[] transmitBuffer, int transmitLength, bool waitForTransmit, int transmitTimeout)
35 | {
36 | _transmitTimeout = transmitTimeout;
37 | _address = adr;
38 | _waitForTransmit = waitForTransmit;
39 | _transmitBuffer = transmitBuffer;
40 | _transmitLength = transmitLength;
41 | _comm = comm;
42 | _waitInvokeId = invokeId;
43 | _comm.OnComplexAck += OnComplexAck;
44 | _comm.OnError += OnError;
45 | _comm.OnAbort += OnAbort;
46 | _comm.OnReject += OnReject;
47 | _comm.OnSimpleAck += OnSimpleAck;
48 | _comm.OnSegment += OnSegment;
49 | _waitHandle = new ManualResetEvent(false);
50 | }
51 |
52 | public void Resend()
53 | {
54 | try
55 | {
56 | if (_comm.Transport.Send(_transmitBuffer, _comm.Transport.HeaderLength, _transmitLength, _address, _waitForTransmit, _transmitTimeout) < 0)
57 | {
58 | Error = new IOException("Write Timeout");
59 | }
60 | }
61 | catch (Exception ex)
62 | {
63 | Error = new Exception($"Write Exception: {ex.Message}");
64 | }
65 | }
66 |
67 | private void OnSegment(BacnetClient sender, BacnetAddress adr, BacnetPduTypes type, BacnetConfirmedServices service, byte invokeId, BacnetMaxSegments maxSegments, BacnetMaxAdpu maxAdpu, byte sequenceNumber, byte[] buffer, int offset, int length)
68 | {
69 | if (invokeId != _waitInvokeId || !adr.Equals(_address))
70 | return;
71 |
72 | Segmented = true;
73 | _waitHandle.Set();
74 | }
75 |
76 | private void OnSimpleAck(BacnetClient sender, BacnetAddress adr, BacnetPduTypes type, BacnetConfirmedServices service, byte invokeId, byte[] data, int dataOffset, int dataLength)
77 | {
78 | if (invokeId != _waitInvokeId || !adr.Equals(_address))
79 | return;
80 |
81 | _waitHandle.Set();
82 | }
83 |
84 | private void OnAbort(BacnetClient sender, BacnetAddress adr, BacnetPduTypes type, byte invokeId, BacnetAbortReason reason, byte[] buffer, int offset, int length)
85 | {
86 | if (invokeId != _waitInvokeId || !adr.Equals(_address))
87 | return;
88 |
89 | Error = new Exception($"Abort from device, reason: {reason}");
90 | }
91 |
92 | private void OnReject(BacnetClient sender, BacnetAddress adr, BacnetPduTypes type, byte invokeId, BacnetRejectReason reason, byte[] buffer, int offset, int length)
93 | {
94 | if (invokeId != _waitInvokeId || !adr.Equals(_address))
95 | return;
96 |
97 | Error = new Exception($"Reject from device, reason: {reason}");
98 | }
99 |
100 | private void OnError(BacnetClient sender, BacnetAddress adr, BacnetPduTypes type, BacnetConfirmedServices service, byte invokeId, BacnetErrorClasses errorClass, BacnetErrorCodes errorCode, byte[] buffer, int offset, int length)
101 | {
102 | if (invokeId != _waitInvokeId || !adr.Equals(_address))
103 | return;
104 |
105 | Error = new Exception($"Error from device: {errorClass} - {errorCode}");
106 | }
107 |
108 | private void OnComplexAck(BacnetClient sender, BacnetAddress adr, BacnetPduTypes type, BacnetConfirmedServices service, byte invokeId, byte[] buffer, int offset, int length)
109 | {
110 | if (invokeId != _waitInvokeId || !adr.Equals(_address))
111 | return;
112 |
113 | Segmented = false;
114 | Result = new byte[length];
115 |
116 | if (length > 0)
117 | Array.Copy(buffer, offset, Result, 0, length);
118 |
119 | //notify waiter even if segmented
120 | _waitHandle.Set();
121 | }
122 |
123 | ///
124 | /// Will continue waiting until all segments are recieved
125 | ///
126 | public bool WaitForDone(int timeout)
127 | {
128 | while (true)
129 | {
130 | if (!AsyncWaitHandle.WaitOne(timeout))
131 | return false;
132 | if (Segmented)
133 | _waitHandle.Reset();
134 | else
135 | return true;
136 | }
137 | }
138 |
139 | public void Dispose()
140 | {
141 | if (_comm != null)
142 | {
143 | _comm.OnComplexAck -= OnComplexAck;
144 | _comm.OnError -= OnError;
145 | _comm.OnAbort -= OnAbort;
146 | _comm.OnReject -= OnReject;
147 | _comm.OnSimpleAck -= OnSimpleAck;
148 | _comm.OnSegment -= OnSegment;
149 | _comm = null;
150 | }
151 |
152 | if (_waitHandle != null)
153 | {
154 | _waitHandle.Dispose();
155 | _waitHandle = null;
156 | }
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/Base/BaCnetCalendarEntry.cs:
--------------------------------------------------------------------------------
1 | namespace System.IO.BACnet;
2 |
3 | public struct BACnetCalendarEntry : ASN1.IEncode, ASN1.IDecode
4 | {
5 | public List