Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
HakanL committed Dec 3, 2024
1 parent 197a9f7 commit f703e90
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 33 deletions.
10 changes: 8 additions & 2 deletions Haukcode.sACN.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29519.87
# Visual Studio Version 17
VisualStudioVersion = 17.12.35521.163 d17.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Haukcode.sACN", "src\Haukcode.sACN\Haukcode.sACN.csproj", "{B8B1A2A4-6F95-4B20-98BE-0916172AE8DD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Haukcode.sACN.UnitTest", "test\Haukcode.sACN.UnitTest.csproj", "{BEBB4D64-93F2-4285-B548-6F1A77622A81}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Haukcode.sACN.ConsoleExample", "example\Haukcode.sACN.ConsoleExample.csproj", "{56232436-1A14-4054-84E1-86647DBD9CC6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Haukcode.HighPerfComm", "..\Haukcode.HighPerfComm\src\Haukcode.HighPerfComm.csproj", "{78DFF33D-589F-4EA6-A1F0-5339F8356055}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -27,6 +29,10 @@ Global
{56232436-1A14-4054-84E1-86647DBD9CC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{56232436-1A14-4054-84E1-86647DBD9CC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56232436-1A14-4054-84E1-86647DBD9CC6}.Release|Any CPU.Build.0 = Release|Any CPU
{78DFF33D-589F-4EA6-A1F0-5339F8356055}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78DFF33D-589F-4EA6-A1F0-5339F8356055}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78DFF33D-589F-4EA6-A1F0-5339F8356055}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78DFF33D-589F-4EA6-A1F0-5339F8356055}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 2 additions & 2 deletions example/Haukcode.sACN.ConsoleExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Haukcode.sACN.ConsoleExample</RootNamespace>
<AssemblyName>ConsoleExample</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Haukcode.Network" Version="1.0.6" />
<PackageReference Include="Haukcode.Network" Version="1.0.10" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void Listen()

while (true)
{
sendClient.SendMulticast(1, new byte[] { 1, 2, 3, 4, 5 });
sendClient.SendDmxData(null, 1, new byte[] { 1, 2, 3, 4, 5 });

Thread.Sleep(500);
}
Expand Down
34 changes: 21 additions & 13 deletions src/Haukcode.sACN/Haukcode.sACN.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@
<Description>A simple sACN library for .NET Core</Description>
<Copyright></Copyright>
<PackageTags>sACN;DMX</PackageTags>
<PackageReleaseNotes>1.0.0 - Refactored
1.0.1 - Added methods to find local IPAddress
1.0.2 - Added method for multi-universe listener
1.0.3 - Changed DMXData property
1.0.4 - Changed API for GetAddressesFromInterfaceType
1.0.5 - Added method to list network adapters
1.0.6 - Removed unused dependency
1.0.7 - Make it Linux-compatible
1.0.8 - Allow unknown operational status on network adapter
2.0.0 - Allow for sync packets, breaking change
2.0.13 - Fix issue with ReceiveMessageFrom and reusing the socket events
2.0.16 - Fix incorrect byte order of Acn Source Id</PackageReleaseNotes>
<PackageReleaseNotes>
1.0.0 - Refactored
1.0.1 - Added methods to find local IPAddress
1.0.2 - Added method for multi-universe listener
1.0.3 - Changed DMXData property
1.0.4 - Changed API for GetAddressesFromInterfaceType
1.0.5 - Added method to list network adapters
1.0.6 - Removed unused dependency
1.0.7 - Make it Linux-compatible
1.0.8 - Allow unknown operational status on network adapter
2.0.0 - Allow for sync packets, breaking change
2.0.13 - Fix issue with ReceiveMessageFrom and reusing the socket events
2.0.16 - Fix incorrect byte order of Acn Source Id
</PackageReleaseNotes>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand All @@ -42,7 +44,13 @@
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>

<ItemGroup>
<!-- Conditional NuGet package reference -->
<ItemGroup Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="Haukcode.HighPerfComm" Version="1.0.7" />
</ItemGroup>

<!-- Conditional project reference for local development -->
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<ProjectReference Include="..\..\..\Haukcode.HighPerfComm\src\Haukcode.HighPerfComm.csproj" />
</ItemGroup>

Expand Down
21 changes: 11 additions & 10 deletions test/BigEndianBinaryReaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Text;
using Haukcode.Network;
using Xunit;

namespace Haukcode.sACN.Test
Expand All @@ -12,8 +13,8 @@ public class BigEndianBinaryReaderTests
[InlineData(32768, 0x80, 0x00)]
public void ReadUInt16(ushort expected, byte first, byte second)
{
MemoryStream stream = new MemoryStream(new byte[] { first, second });
BigEndianBinaryReader reader = new BigEndianBinaryReader(new ReadOnlyMemory<byte>(stream.GetBuffer()));
var stream = new MemoryStream(new byte[] { first, second });
var reader = new BigEndianBinaryReader(new ReadOnlyMemory<byte>(stream.GetBuffer()));
ushort actual = reader.ReadUInt16();

Assert.Equal(expected, actual);
Expand All @@ -23,8 +24,8 @@ public void ReadUInt16(ushort expected, byte first, byte second)
[InlineData(16384, 0x40, 0x00)]
public void ReadInt16_Positive(short expected, byte first, byte second)
{
MemoryStream stream = new MemoryStream(new byte[] { first, second });
BigEndianBinaryReader reader = new BigEndianBinaryReader(new ReadOnlyMemory<byte>(stream.GetBuffer()));
var stream = new MemoryStream(new byte[] { first, second });
var reader = new BigEndianBinaryReader(new ReadOnlyMemory<byte>(stream.GetBuffer()));
short actual = reader.ReadInt16();

Assert.Equal(expected, actual);
Expand All @@ -34,8 +35,8 @@ public void ReadInt16_Positive(short expected, byte first, byte second)
[InlineData(-8192, 0xE0, 0x00)]
public void ReadInt16_Negative(short expected, byte first, byte second)
{
MemoryStream stream = new MemoryStream(new byte[] { first, second });
BigEndianBinaryReader reader = new BigEndianBinaryReader(new ReadOnlyMemory<byte>(stream.GetBuffer()));
var stream = new MemoryStream(new byte[] { first, second });
var reader = new BigEndianBinaryReader(new ReadOnlyMemory<byte>(stream.GetBuffer()));
short actual = reader.ReadInt16();

Assert.Equal(expected, actual);
Expand All @@ -45,8 +46,8 @@ public void ReadInt16_Negative(short expected, byte first, byte second)
[InlineData(268435456, 0x10, 0x00, 0x00, 0x00)]
public void ReadInt32_Positive(int expected, byte first, byte second, byte third, byte fourth)
{
MemoryStream stream = new MemoryStream(new byte[] { first, second, third, fourth });
BigEndianBinaryReader reader = new BigEndianBinaryReader(new ReadOnlyMemory<byte>(stream.GetBuffer()));
var stream = new MemoryStream(new byte[] { first, second, third, fourth });
var reader = new BigEndianBinaryReader(new ReadOnlyMemory<byte>(stream.GetBuffer()));
int actual = reader.ReadInt32();

Assert.Equal(expected, actual);
Expand All @@ -56,8 +57,8 @@ public void ReadInt32_Positive(int expected, byte first, byte second, byte third
[InlineData(-268435456, 0xF0, 0x00, 0x00, 0x00)]
public void ReadInt32_Negative(int expected, byte first, byte second, byte third, byte fourth)
{
MemoryStream stream = new MemoryStream(new byte[] { first, second, third, fourth });
BigEndianBinaryReader reader = new BigEndianBinaryReader(new ReadOnlyMemory<byte>(stream.GetBuffer()));
var stream = new MemoryStream(new byte[] { first, second, third, fourth });
var reader = new BigEndianBinaryReader(new ReadOnlyMemory<byte>(stream.GetBuffer()));
int actual = reader.ReadInt32();

Assert.Equal(expected, actual);
Expand Down
10 changes: 5 additions & 5 deletions test/Haukcode.sACN.UnitTest.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Haukcode.sACN.UnitTest</RootNamespace>

<IsPackable>false</IsPackable>
Expand All @@ -10,13 +10,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit f703e90

Please sign in to comment.