-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix NPE in AbstractInstance while no PortConfigs are set
Bump v0.0.27
- Loading branch information
1 parent
1966dfa
commit b187c85
Showing
7 changed files
with
101 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\ArtNetSharp\ArtNetSharp.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// This file is used by Code Analysis to maintain SuppressMessage | ||
// attributes that are applied to this project. | ||
// Project-level suppressions either have no target or are given | ||
// a specific target and scoped to a namespace, type, member, etc. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
|
||
[assembly: SuppressMessage("Style", "IDE0090:\"new(...)\" verwenden", Justification = "<Ausstehend>")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using ArtNetSharp; | ||
using ArtNetSharp.Communication; | ||
|
||
Console.WriteLine("Config Example!"); | ||
|
||
//Add Logging | ||
//ArtNet.SetLoggerFectory(YOUR_LOGGER_FACTORY); | ||
|
||
//Set Networkinterfaces | ||
//var broadcastIp = new IPAddress(new byte[] { 2, 255, 255, 255 }); | ||
//ArtNet.Instance.NetworkClients.ToList().ForEach(ncb => ncb.Enabled = IPAddress.Equals(broadcastIp, ncb.BroadcastIpAddress)); | ||
|
||
// Create Instance | ||
ConfigInstance controllerInstance = new ConfigInstance(ArtNet.Instance); | ||
controllerInstance.Name = controllerInstance.ShortName = "Config Example"; | ||
|
||
// Configure Ports | ||
//for (byte i = 1; i <= 32; i++) | ||
// controllerInstance.AddPortConfig(new PortConfig(i, new PortAddress((ushort)(i - 1)), false, true) { PortNumber = (byte)i, Type = EPortType.InputToArtNet | EPortType.ArtNet }); | ||
|
||
// Add Instance | ||
ArtNet.Instance.AddInstance(controllerInstance); | ||
controllerInstance.RemoteClientDiscovered += (o, e) => | ||
{ | ||
Console.WriteLine($"Discovered: {e.IpAddress}"); | ||
e.PortDiscovered += (o1, e1) => | ||
{ | ||
e1.PropertyChanged += (o2, e2) => | ||
{ | ||
if (e2.PropertyName?.Equals(nameof(RemoteClientPort.LastSeen)) ?? true) | ||
return; | ||
|
||
Console.WriteLine($"{e.IpAddress}/{e1.PortIndex}:{e2.PropertyName} changed"); | ||
}; | ||
}; | ||
}; controllerInstance.RemoteClientTimedOut += (o, e) => | ||
{ | ||
Console.WriteLine($"TimedOuted: {e.IpAddress}"); | ||
}; | ||
Console.ReadLine(); | ||
|
||
// Genrerate some DMX-Data | ||
//byte[] data = new byte[512]; | ||
//while (true) | ||
//{ | ||
// await Task.Delay(200); | ||
// for (short k = 0; k < 512; k++) | ||
// data[k]++; | ||
|
||
// for (ushort i = 0; i < 32; i++) | ||
// controllerInstance.WriteDMXValues(i, data); | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
global using org.dmxc.wkdt.Light.ArtNet; |