Skip to content

Commit ee56ae8

Browse files
committed
testing mall-formed packets
1 parent 725b82d commit ee56ae8

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

test/Ethernet.h

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,37 @@ class EthernetUDP
3030
{
3131
// rtp-MIDI and AppleMIDI messages
3232

33-
byte aa[] = {
33+
byte rr1[] = {
34+
0x80, 0x61, 0x19, 0x07, 0x00, 0x16,
35+
0xd5, 0x87, 0xf2, 0x2d, 0x56, 0xc3, 0xc0, 0x14, 0x92, 0x71, 0x00, 0x8f, 0xff, 0xff, 0xfe, 0x00,
36+
0x94, 0x64, 0x00, 0x81, 0x5a, 0x90, 0x64, 0x00, 0x02, 0x92, 0x64, 0x00, 0x23, 0x18, 0xf7, 0x00,
37+
0x19, 0x08, 0x89, 0xcd, 0x64, 0x7f, 0xf0, 0x78, 0xf1, 0x78, 0xf2, 0x78, 0xf3, 0x78, 0xf4, 0x78,
38+
0xf5, 0x78, 0xf6, 0x78, 0xf7, 0x78, 0xf0, 0x0f, 0x10, 0x13, 0x08, 0x86, 0xcd, 0x64, 0x7f, 0xf0,
39+
0x78, 0x71, 0x7f, 0xf2, 0x78, 0xf3, 0x78, 0xf4, 0x78, 0xf0, 0x0f, 0x20, 0x15, 0x08, 0x87, 0xcd,
40+
0x64, 0x7f, 0xf0, 0x78, 0xf1, 0x7f, 0xf4, 0x78, 0xf5, 0x7f, 0xf8, 0x78, 0xf9, 0x7f, 0xf0, 0x0f,
41+
0xd0, 0x07, 0x08, 0x81, 0xf1, 0xe0, 0x78
42+
};
43+
44+
byte rr2[] = {
45+
0x80, 0x61, 0x19, 0x14, 0x00, 0x16,
46+
0xf2, 0xd3, 0xf2, 0x2d, 0x56, 0xc3, 0x4b, 0x92, 0x71, 0x00, 0x8f, 0xff, 0xff, 0xfe, 0x00, 0x94,
47+
0x6a, 0x00, 0x23, 0x19, 0x04, 0x00, 0x19, 0x08, 0x89, 0xcd, 0x6a, 0x7f, 0xf0, 0x78, 0xf1, 0x78,
48+
0xf2, 0x78, 0xf3, 0x78, 0xf4, 0x78, 0xf5, 0x78, 0xf6, 0x78, 0xf7, 0x78, 0x1f, 0xc0, 0x10, 0x13,
49+
0x08, 0x86, 0xcd, 0x6a, 0x7f, 0xf0, 0x78, 0x71, 0x7f, 0xf2, 0x78, 0xf3, 0x78, 0xf4, 0x78, 0x1f,
50+
0xc0, 0x20, 0x15, 0x08, 0x87, 0xcd, 0x6a, 0x7f, 0xf0, 0x78, 0xf1, 0x7f, 0xf4, 0x78, 0xf5, 0x7f,
51+
0xf8, 0x78, 0xf9, 0x7f, 0x1f, 0xc0, 0xd0, 0x07, 0x08, 0x81, 0xf1, 0xe0, 0x78
52+
};
53+
54+
byte rr[] = {
55+
0x80, 0x61, 0x19, 0x05, 0x00, 0x16,
56+
0xcf, 0xe0, 0xf2, 0x2d, 0x56, 0xc3, 0x4c, 0x94, 0x63, 0x00, 0x81, 0x6a, 0x90, 0x63, 0x00, 0x02,
57+
0x92, 0x63, 0x00, 0x23, 0x18, 0xf5, 0x00, 0x19, 0x08, 0x89, 0xcd, 0x63, 0x7f, 0xf0, 0x78, 0xf1,
58+
0x78, 0xf2, 0x78, 0xf3, 0x78, 0xf4, 0x78, 0xf5, 0x78, 0xf6, 0x78, 0xf7, 0x78, 0xe0, 0x1f, 0x10,
59+
0x11, 0x08, 0x85, 0xcd, 0x63, 0x7f, 0xf0, 0x78, 0xf2, 0x78, 0xf3, 0x78, 0xf4, 0x78, 0xe0, 0x1f,
60+
0x20, 0x15, 0x08, 0x87, 0xcd, 0x63, 0x7f, 0xf0, 0x78, 0xf1, 0x7f, 0xf4, 0x78, 0xf5, 0x7f, 0xf8,
61+
0x78, 0xf9, 0x7f, 0xe0, 0x1f, 0xd0, 0x07, 0x08, 0x81, 0xf1, 0xe0, 0x78 };
62+
63+
byte aa[] = {
3464
0x80, 0x61, 0xbf, 0xa2, 0x12, 0xb, 0x5a, 0xf7, 0xaa, 0x34, 0x96, 0x4a,
3565
0xc0, 0x2b,
3666
0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x0, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x0,
@@ -279,10 +309,8 @@ class EthernetUDP
279309

280310
byte slecht[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06};
281311

282-
write(noteOnOff, sizeof(noteOnOff));
312+
write(rr2, sizeof(rr2));
283313
}
284-
285-
286314

287315
if (port == 5005 && true)
288316
{

test/NoteOn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void begin()
103103
DBG(F("Select and then press the Connect button"));
104104
DBG(F("Then open a MIDI listener and monitor incoming notes"));
105105

106-
MIDI.begin();
106+
MIDI.begin(MIDI_CHANNEL_OMNI);
107107

108108
AppleMIDI.setHandleConnected(OnAppleMidiConnected);
109109
AppleMIDI.setHandleDisconnected(OnAppleMidiDisconnected);

0 commit comments

Comments
 (0)