Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bacnet 1.0.20 beta #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,5 @@ paket-files/

# JetBrains Rider
.idea/
*.sln.iml
*.sln.iml
AnotherStorageImplementation/packages.config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you add packages.config to ignored?

181 changes: 93 additions & 88 deletions AnotherStorageImplementation/AnotherStorageImplementation.csproj
Original file line number Diff line number Diff line change
@@ -1,95 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{EE8E3C58-371E-4164-93DA-13D055D5BDDE}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BaCSharp</RootNamespace>
<AssemblyName>AnotherStorageImplementation</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="BACnet, Version=1.0.8.5, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\BACnet.1.0.8.5-alpha\lib\net40\BACnet.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PacketDotNet, Version=0.13.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\PacketDotNet.0.13.0\lib\net\PacketDotNet.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SharpPcap, Version=4.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SharpPcap.4.2.0\lib\net\SharpPcap.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<Compile Include="BacnetActivity.cs" />
<Compile Include="BacnetObjects\AnalogInput.cs" />
<Compile Include="BacnetObjects\AnalogObject.cs" />
<Compile Include="BacnetObjects\AnalogObjectEvent.cs" />
<Compile Include="BacnetObjects\AnalogOutput.cs" />
<Compile Include="BacnetObjects\BacnetFile.cs" />
<Compile Include="BacnetObjects\BaCSharpObject.cs" />
<Compile Include="BacnetObjects\BaCSharpType.cs" />
<Compile Include="BacnetObjects\BinaryInput.cs" />
<Compile Include="BacnetObjects\BinaryObject.cs" />
<Compile Include="BacnetObjects\BinaryOutput.cs" />
<Compile Include="BacnetObjects\Calendar.cs" />
<Compile Include="BacnetObjects\CharacterString.cs" />
<Compile Include="BacnetObjects\DeviceObject.cs" />
<Compile Include="BacnetObjects\MultiStateInput.cs" />
<Compile Include="BacnetObjects\MultiStateOutput.cs" />
<Compile Include="BacnetObjects\NotificationClass.cs" />
<Compile Include="BacnetObjects\Schedule.cs" />
<Compile Include="BacnetObjects\StructuredView.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="BacnetObjects\TrendLog.cs" />
<Compile Include="BacnetObjects\TrendLogCustom.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Subscription.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{EE8E3C58-371E-4164-93DA-13D055D5BDDE}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BaCSharp</RootNamespace>
<AssemblyName>AnotherStorageImplementation</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=3.4.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<HintPath>C:\Users\sschulze.PLUETH\source\repos\BACnetCommand\packages\Common.Logging.3.4.1\lib\net40\Common.Logging.dll</HintPath>
</Reference>
<Reference Include="Common.Logging.Core, Version=3.4.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<HintPath>C:\Users\sschulze.PLUETH\source\repos\BACnetCommand\packages\Common.Logging.Core.3.4.1\lib\net40\Common.Logging.Core.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>C:\Users\sschulze.PLUETH\source\repos\BACnetCommand\packages\Newtonsoft.Json.11.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PacketDotNet, Version=0.16.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>C:\Users\sschulze.PLUETH\source\repos\BACnetCommand\packages\PacketDotNet.0.16.0\lib\PacketDotNet.dll</HintPath>
</Reference>
<Reference Include="SharpPcap, Version=4.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>C:\Users\sschulze.PLUETH\source\repos\BACnetCommand\packages\SharpPcap.4.4.0\lib\SharpPcap.dll</HintPath>
</Reference>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hintpaths are invalid! use relative paths

<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<Compile Include="BacnetActivity.cs" />
<Compile Include="BacnetObjects\AnalogInput.cs" />
<Compile Include="BacnetObjects\AnalogObject.cs" />
<Compile Include="BacnetObjects\AnalogObjectEvent.cs" />
<Compile Include="BacnetObjects\AnalogOutput.cs" />
<Compile Include="BacnetObjects\BacnetFile.cs" />
<Compile Include="BacnetObjects\BaCSharpObject.cs" />
<Compile Include="BacnetObjects\BaCSharpType.cs" />
<Compile Include="BacnetObjects\BinaryInput.cs" />
<Compile Include="BacnetObjects\BinaryObject.cs" />
<Compile Include="BacnetObjects\BinaryOutput.cs" />
<Compile Include="BacnetObjects\Calendar.cs" />
<Compile Include="BacnetObjects\CharacterString.cs" />
<Compile Include="BacnetObjects\DeviceObject.cs" />
<Compile Include="BacnetObjects\MultiStateInput.cs" />
<Compile Include="BacnetObjects\MultiStateOutput.cs" />
<Compile Include="BacnetObjects\NotificationClass.cs" />
<Compile Include="BacnetObjects\Schedule.cs" />
<Compile Include="BacnetObjects\StructuredView.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="BacnetObjects\TrendLog.cs" />
<Compile Include="BacnetObjects\TrendLogCustom.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Subscription.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\BACnet\BACnet.csproj">
<Project>{66832876-01fc-4b7c-8d92-54195773fabf}</Project>
<Name>BACnet</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
-->
</Project>
34 changes: 17 additions & 17 deletions AnotherStorageImplementation/BacnetObjects/AnalogObjectEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ private void IntrinsicReportingManagement()
double ll = Convert.ToDouble(m_PROP_LOW_LIMIT);
double db = Convert.ToDouble(m_PROP_DEADBAND);

bool LimitEnabledHigh = (m_PROP_LIMIT_ENABLE.value[0] & (uint)BacnetEventNotificationData.BacnetLimitEnable.EVENT_HIGH_LIMIT_ENABLE) != 0;
bool LimitEnabledLow = (m_PROP_LIMIT_ENABLE.value[0] & (uint)BacnetEventNotificationData.BacnetLimitEnable.EVENT_LOW_LIMIT_ENABLE) != 0;
bool LimitEnabledHigh = (m_PROP_LIMIT_ENABLE.value[0] & (uint)BacnetLimitEnable.EVENT_HIGH_LIMIT_ENABLE) != 0;
bool LimitEnabledLow = (m_PROP_LIMIT_ENABLE.value[0] & (uint)BacnetLimitEnable.EVENT_LOW_LIMIT_ENABLE) != 0;

bool EventToOffNormal = (m_PROP_EVENT_ENABLE.value[0] & (uint)BacnetEventNotificationData.BacnetEventEnable.EVENT_ENABLE_TO_OFFNORMAL) != 0;
bool EventToNormal = (m_PROP_EVENT_ENABLE.value[0] & (uint)BacnetEventNotificationData.BacnetEventEnable.EVENT_ENABLE_TO_NORMAL) != 0;
bool EventToOffNormal = (m_PROP_EVENT_ENABLE.value[0] & (uint)BacnetEventEnable.EVENT_ENABLE_TO_OFFNORMAL) != 0;
bool EventToNormal = (m_PROP_EVENT_ENABLE.value[0] & (uint)BacnetEventEnable.EVENT_ENABLE_TO_NORMAL) != 0;

bool NotifyState = false;

Expand All @@ -185,48 +185,48 @@ private void IntrinsicReportingManagement()

switch (fromState)
{
case (uint)BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_NORMAL :
case (uint)BacnetEventStates.EVENT_STATE_NORMAL :
/* If LimitHigh flag is enabled and Present_Value exceed the High_Limit and Event to Offnormal is enabled then
the notification must be done */
if ((pv > hl)&&LimitEnabledHigh)
{
toState = (int)BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_HIGH_LIMIT;
toState = (int)BacnetEventStates.EVENT_STATE_HIGH_LIMIT;
NotifyState = EventToOffNormal;
}
/* If LowLimit flag is enabled and Present_Value exceed the Low_Limit and Event to Offnormal is enabled then
the notification must be done */
if ((pv < ll)&LimitEnabledLow)
{
toState = (int)BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_LOW_LIMIT;
toState = (int)BacnetEventStates.EVENT_STATE_LOW_LIMIT;
NotifyState = EventToOffNormal;
}
break;
case (uint)BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_HIGH_LIMIT:
case (uint)BacnetEventStates.EVENT_STATE_HIGH_LIMIT:
/* Present_Value fall below the High_Limit - Deadband ? */
if (pv < (hl - db))
{
toState = (int)BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_NORMAL;
toState = (int)BacnetEventStates.EVENT_STATE_NORMAL;
NotifyState = EventToNormal;
}
/* Present_Value fall below the Low_Limit ? */
if ((pv < ll) && LimitEnabledLow)
{
toState = (int)BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_LOW_LIMIT;
toState = (int)BacnetEventStates.EVENT_STATE_LOW_LIMIT;
if (!NotifyState)
NotifyState = EventToOffNormal;
}
break;
case (uint)BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_LOW_LIMIT:
case (uint)BacnetEventStates.EVENT_STATE_LOW_LIMIT:
/* Present_Value exceed the Low_Limit + Deadband ? */
if (pv > (ll + db))
{
toState = (int)BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_NORMAL;
toState = (int)BacnetEventStates.EVENT_STATE_NORMAL;
NotifyState = EventToNormal;
}
/* Present_Value exceed the High_Limit ? */
if ((pv > hl) && LimitEnabledHigh)
{
toState = (int)BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_HIGH_LIMIT;
toState = (int)BacnetEventStates.EVENT_STATE_HIGH_LIMIT;
if (!NotifyState)
NotifyState = EventToOffNormal;
}
Expand Down Expand Up @@ -256,10 +256,10 @@ the notification must be done */
if (nc!=null)
nc.SendIntrinsectEvent(
m_PROP_OBJECT_IDENTIFIER,
(BacnetEventNotificationData.BacnetNotifyTypes)m_PROP_NOTIFY_TYPE,
BacnetEventNotificationData.BacnetEventTypes.EVENT_CHANGE_OF_VALUE,
(BacnetEventNotificationData.BacnetEventStates)fromState,
(BacnetEventNotificationData.BacnetEventStates)toState);
(BacnetNotifyTypes)m_PROP_NOTIFY_TYPE,
BacnetEventTypes.EVENT_CHANGE_OF_STATE,
(BacnetEventStates)fromState,
(BacnetEventStates)toState);
}
}
}
14 changes: 7 additions & 7 deletions AnotherStorageImplementation/BacnetObjects/NotificationClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ public void AddReportingRecipient(DeviceReportingRecipient recipient)
}

public void SendIntrinsectEvent(BacnetObjectId SenderObject,
BacnetEventNotificationData.BacnetNotifyTypes notifyType,
BacnetEventNotificationData.BacnetEventTypes evenType,
BacnetEventNotificationData.BacnetEventStates fromstate,
BacnetEventNotificationData.BacnetEventStates tostate)
BacnetNotifyTypes notifyType,
BacnetEventTypes evenType,
BacnetEventStates fromstate,
BacnetEventStates tostate)
{

if ((m_PROP_RECIPIENT_LIST == null) || (m_PROP_RECIPIENT_LIST.Count == 0))
Expand Down Expand Up @@ -166,11 +166,11 @@ public void SendIntrinsectEvent(BacnetObjectId SenderObject,
DoASend = false;

// new State is OK ?
if ((tostate == BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_OFFNORMAL) && ((devReportEntry.evenType.value[0] & 1) != 1))
if ((tostate == BacnetEventStates.EVENT_STATE_OFFNORMAL) && ((devReportEntry.evenType.value[0] & 1) != 1))
DoASend = false;
if ((tostate == BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_NORMAL) && ((devReportEntry.evenType.value[0] & 2) != 2))
if ((tostate == BacnetEventStates.EVENT_STATE_NORMAL) && ((devReportEntry.evenType.value[0] & 2) != 2))
DoASend = false;
if ((tostate == BacnetEventNotificationData.BacnetEventStates.EVENT_STATE_FAULT) && ((devReportEntry.evenType.value[0] & 4) != 4))
if ((tostate == BacnetEventStates.EVENT_STATE_FAULT) && ((devReportEntry.evenType.value[0] & 4) != 4))
DoASend = false;

// Find the receiver endPoint
Expand Down
14 changes: 8 additions & 6 deletions AnotherStorageImplementation/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BACnet" version="1.0.8.5-alpha" targetFramework="net40-client" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net40-client" />
<package id="PacketDotNet" version="0.13.0" targetFramework="net40-client" />
<package id="SharpPcap" version="4.2.0" targetFramework="net40-client" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BACnet" version="1.0.20-beta" targetFramework="net40-client" />
<package id="Common.Logging" version="3.4.1" targetFramework="net40-client" />
<package id="Common.Logging.Core" version="3.4.1" targetFramework="net40-client" />
<package id="Newtonsoft.Json" version="11.0.1" targetFramework="net40-client" />
<package id="PacketDotNet" version="0.16.0" targetFramework="net40-client" />
<package id="SharpPcap" version="4.4.0" targetFramework="net40-client" />
</packages>