Skip to content

Commit

Permalink
Fix compatibility with CDJ-3000s as players 5 and 6, fixes #63
Browse files Browse the repository at this point in the history
  • Loading branch information
brunchboy committed Nov 7, 2023
1 parent 2727ab6 commit 256ede6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ This change log follows the conventions of

### Fixed

- We now send startup and keep-alive packets in a way that is compatible even with
CDJ-3000s that are using player numbers 5 and 6 (they no longer display a warning
dialog nor drop off the network).
- The calculation of pitch percentages from pitch values found in CDJ status packets
was slightly inaccurate because of two transposed digits in a calculation.
- The code that detects pre-nexus CDJs was confused by the CDJ-3000.
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/deepsymmetry/beatlink/VirtualCdj.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ public void setAnnounceInterval(int interval) {
private static final byte[] keepAliveBytes = {
0x51, 0x73, 0x70, 0x74, 0x31, 0x57, 0x6d, 0x4a, 0x4f, 0x4c, 0x06, 0x00, 0x62, 0x65, 0x61, 0x74,
0x2d, 0x6c, 0x69, 0x6e, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x02, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00
0x01, 0x02, 0x00, 0x36, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x01, 0x64
};

/**
Expand Down Expand Up @@ -247,7 +247,7 @@ public synchronized void setDeviceName(String name) {
private static final byte[] helloBytes = {
0x51, 0x73, 0x70, 0x74, 0x31, 0x57, 0x6d, 0x4a, 0x4f, 0x4c, 0x0a, 0x00, 0x62, 0x65, 0x61, 0x74,
0x2d, 0x6c, 0x69, 0x6e, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x02, 0x00, 0x25, 0x01
0x01, 0x04, 0x00, 0x26, 0x01, 0x40
};

/**
Expand All @@ -256,7 +256,7 @@ public synchronized void setDeviceName(String name) {
private static final byte[] claimStage1bytes = {
0x51, 0x73, 0x70, 0x74, 0x31, 0x57, 0x6d, 0x4a, 0x4f, 0x4c, 0x00, 0x00, 0x62, 0x65, 0x61, 0x74,
0x2d, 0x6c, 0x69, 0x6e, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x02, 0x00, 0x2c, 0x0d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x01, 0x03, 0x00, 0x2c, 0x0d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

/**
Expand All @@ -265,7 +265,7 @@ public synchronized void setDeviceName(String name) {
private static final byte[] claimStage2bytes = {
0x51, 0x73, 0x70, 0x74, 0x31, 0x57, 0x6d, 0x4a, 0x4f, 0x4c, 0x02, 0x00, 0x62, 0x65, 0x61, 0x74,
0x2d, 0x6c, 0x69, 0x6e, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x02, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00,
0x01, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00,
0x01, 0x00
};

Expand All @@ -275,7 +275,7 @@ public synchronized void setDeviceName(String name) {
private static final byte[] claimStage3bytes = {
0x51, 0x73, 0x70, 0x74, 0x31, 0x57, 0x6d, 0x4a, 0x4f, 0x4c, 0x04, 0x00, 0x62, 0x65, 0x61, 0x74,
0x2d, 0x6c, 0x69, 0x6e, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x02, 0x00, 0x26, 0x0d, 0x00
0x01, 0x03, 0x00, 0x26, 0x0d, 0x00
};

/**
Expand Down

0 comments on commit 256ede6

Please sign in to comment.