Skip to content

Commit 670b866

Browse files
committed
Add Test for Ayrton Domino S Binary
Fix Tests
1 parent e42ab55 commit 670b866

File tree

7 files changed

+71
-5
lines changed

7 files changed

+71
-5
lines changed

ArtNetSharp/Communication/AbstractInstance.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,7 @@ public async Task SendArtRDM(RDMMessage rdmMessage)
732732
{
733733
var ports = RemoteClientsPorts.Where(port => port.KnownResponderRDMUIDs.Count != 0).Where(port => port.OutputPortAddress.HasValue && port.KnownResponderRDMUIDs.Any(bag => bag.Uid == rdmMessage.DestUID)).ToList();
734734
List<Task> tasks = new List<Task>();
735+
List<Tuple<IPv4Address, PortAddress>> tuples = new List<Tuple<IPv4Address, PortAddress>>();
735736
foreach (var port in ports)
736737
{
737738
PortAddress pa = default;
@@ -740,6 +741,9 @@ public async Task SendArtRDM(RDMMessage rdmMessage)
740741
else if (rdmMessage.Command.HasFlag(ERDM_Command.RESPONSE) && port.InputPortAddress.HasValue)
741742
pa = port.InputPortAddress.Value;
742743
//Todo Buffer per IP address to prevent Hardware from overflow
744+
if (tuples.Any(t => t.Item2 == pa && t.Item1 == port.IpAddress))// skip multiple send the same Package to the same IP
745+
continue;
746+
tuples.Add(new Tuple<IPv4Address, PortAddress>(port.IpAddress, pa));
743747
ArtRDM artRDM = new ArtRDM(pa, rdmMessage);
744748
tasks.Add(Task.Run(async () => await TrySendPacket(artRDM, port.IpAddress)));
745749
}

ArtNetTests/Binary Tests/ArtPollReplyBinaryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace ArtNetTests.Binary_Tests
99
[TestFixtureSource(typeof(AbstractArtPollReplyBinaryTestSubject), nameof(AbstractArtPollReplyBinaryTestSubject.TestSubjects))]
1010
public class ArtPollReplyBinaryTests
1111
{
12-
private static readonly ILogger Logger = ApplicationLogging.CreateLogger<ArtPollReplyBinaryTests>();
12+
private static readonly ILogger Logger = ArtNetSharp.Logging.CreateLogger<ArtPollReplyBinaryTests>();
1313
private readonly AbstractArtPollReplyBinaryTestSubject testSubject;
1414

1515
public ArtPollReplyBinaryTests(AbstractArtPollReplyBinaryTestSubject _TestSubject)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
using ArtNetSharp;
2+
3+
namespace ArtNetTests.Binary_Tests.Ayrton
4+
{
5+
internal class Ayrton_Domino_S_2_2_4 : AbstractArtPollReplyBinaryTestSubject
6+
{
7+
private static readonly byte[] DATA = [
8+
0x41, 0x72, 0x74, 0x2d, 0x4e, 0x65, 0x74, 0x00,
9+
0x00, 0x21, 0x02, 0x03, 0x04, 0x05, 0x36, 0x19,
10+
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x12,
11+
0x79, 0x41, 0x44, 0x4f, 0x4d, 0x49, 0x4e, 0x4f,
12+
0x20, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
13+
0x00, 0x00, 0x00, 0x00, 0x41, 0x59, 0x52, 0x54,
14+
0x4f, 0x4e, 0x20, 0x44, 0x4f, 0x4d, 0x49, 0x4e,
15+
0x4f, 0x20, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00,
16+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
17+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
18+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
19+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
20+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
22+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
23+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
24+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
25+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
26+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
27+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
28+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
29+
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00,
30+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
31+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
32+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
33+
0x00, 0x00, 0x06, 0x5f, 0x00, 0x01, 0x81, 0x02,
34+
0x03, 0x04, 0x05, 0x01, 0x00, 0x04, 0x00, 0x00,
35+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
36+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
37+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ];
38+
39+
private static readonly PortTestSubject[] PORTS =
40+
[
41+
new PortTestSubject(EPortType.OutputFromArtNet,(Address)0,(Address)0)
42+
];
43+
public Ayrton_Domino_S_2_2_4() : base(
44+
"Ayrton Dimino S (FW 2.2.4)",
45+
DATA,
46+
0,
47+
"DOMINO S",
48+
"AYRTON DOMINO S",
49+
new MACAddress("00:06:5f:00:01:81"),
50+
new IPv4Address("2.3.4.5"),
51+
new IPv4Address("2.3.4.5"),
52+
0x00ff,
53+
0x4179,
54+
EStCodes.StNode,
55+
PORTS,
56+
false,
57+
majorVersion: 0,
58+
minorVersion: 0)
59+
{
60+
}
61+
}
62+
}

ArtNetTests/Binary Tests/Robe/Robe_Esprite_3_9.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using ArtNetSharp;
22

3-
namespace ArtNetTests.Binary_Tests.Astera
3+
namespace ArtNetTests.Binary_Tests.Robe
44
{
55
internal class Robe_Esprite_3_9 : AbstractArtPollReplyBinaryTestSubject
66
{

ArtNetTests/Binary Tests/Robe/Robe_Tetra2_3_5.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using ArtNetSharp;
22

3-
namespace ArtNetTests.Binary_Tests.Astera
3+
namespace ArtNetTests.Binary_Tests.Robe
44
{
55
internal class Robe_Tetra2_3_5 : AbstractArtPollReplyBinaryTestSubject
66
{

ArtNetTests/LoggingTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public void TestLogging()
1515
logger.LogWarning(new Exception("Test"));
1616
logger.LogError(new Exception("Test"));
1717
logger.LogCritical(new Exception("Test"));
18-
logger = ApplicationLogging.CreateLogger<LoggingTests>();
18+
logger = ArtNetSharp.Logging.CreateLogger<LoggingTests>();
1919
logger.LogTrace(new Exception("Test"));
2020
logger.LogDebug(new Exception("Test"));
2121
logger.LogInformation(new Exception("Test"));

ArtNetTests/TestOS.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace ArtNetTests
1010
[Order(30)]
1111
public class TestOS
1212
{
13-
private static readonly ILogger Logger = ApplicationLogging.CreateLogger<TestOS>();
13+
private static readonly ILogger Logger = ArtNetSharp.Logging.CreateLogger<TestOS>();
1414
private NodeInstance nodeInstance;
1515
private ControllerInstance controllerInstance;
1616
private const byte ports = 2;

0 commit comments

Comments
 (0)