Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/devices/audeze_maxwell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace headsetcontrol {
* - Mic noise filter
*
* Special Requirements:
* - 15-packet initialization sequence followed by 6 status requests
* - 14-packet initialization sequence followed by 6 status requests
* - 60ms delay between packets (official software sends at 52ms but 60ms is more reliable in testing)
* - Uses hid_get_input_report for responses
*/
Expand All @@ -40,8 +40,8 @@ class AudezeMaxwell : public HIDDevice {
static constexpr int REPORT_ID = 0x06;
static constexpr int DELAY_US = 60000; // 60ms

// 15-packet initialization sequence
static constexpr std::array<std::array<uint8_t, MSG_SIZE>, 15> UNIQUE_REQUESTS { { { 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x01, 0x09, 0x20 },
// 14-packet initialization sequence
static constexpr std::array<std::array<uint8_t, MSG_SIZE>, 14> UNIQUE_REQUESTS { { { 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x01, 0x09, 0x20 },
{ 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x01, 0x09, 0x25 },
{ 0x06, 0x07, 0x80, 0x05, 0x5A, 0x03, 0x00, 0x07, 0x1C },
{ 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x01, 0x09, 0x28 },
Expand All @@ -54,7 +54,6 @@ class AudezeMaxwell : public HIDDevice {
{ 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x83, 0x2C, 0x0B },
{ 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x01, 0x09, 0x24 },
{ 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x01, 0x09, 0x2F },
{ 0x06, 0x09, 0x80, 0x05, 0x5A, 0x05, 0x00, 0x00, 0x09, 0x25, 0x00, 0x7A },
{ 0x06, 0x07, 0x80, 0x05, 0x5A, 0x03, 0x00, 0xD6, 0x0C } } };

// 6 packet status request sequence
Expand Down
11 changes: 5 additions & 6 deletions lib/devices/audeze_maxwell2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace headsetcontrol {
* - Mic noise filter
*
* Special Requirements:
* - 15-packet initialization sequence followed by 6 status requests
* - 14-packet initialization sequence followed by 6 status requests
* - 60ms delay between packets (official software sends at 52ms but 60ms is more reliable in testing)
* - Uses hid_get_input_report for responses
*/
Expand All @@ -40,8 +40,8 @@ class AudezeMaxwell2 : public HIDDevice {
static constexpr int REPORT_ID = 0x06;
static constexpr int DELAY_US = 60000; // 60ms

// 15-packet initialization sequence
static constexpr std::array<std::array<uint8_t, MSG_SIZE>, 15> UNIQUE_REQUESTS { { { 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x01, 0x09, 0x20 },
// 14-packet initialization sequence
static constexpr std::array<std::array<uint8_t, MSG_SIZE>, 14> UNIQUE_REQUESTS { { { 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x01, 0x09, 0x20 },
{ 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x01, 0x09, 0x25 },
{ 0x06, 0x07, 0x80, 0x05, 0x5A, 0x03, 0x00, 0x07, 0x1C },
{ 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x01, 0x09, 0x28 },
Expand All @@ -54,7 +54,6 @@ class AudezeMaxwell2 : public HIDDevice {
{ 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x83, 0x2C, 0x0B },
{ 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x01, 0x09, 0x24 },
{ 0x06, 0x08, 0x80, 0x05, 0x5A, 0x04, 0x00, 0x01, 0x09, 0x2F },
{ 0x06, 0x09, 0x80, 0x05, 0x5A, 0x05, 0x00, 0x00, 0x09, 0x25, 0x00, 0x7A },
{ 0x06, 0x07, 0x80, 0x05, 0x5A, 0x03, 0x00, 0xD6, 0x0C } } };

// 6 packet status request sequence
Expand Down Expand Up @@ -153,8 +152,8 @@ class AudezeMaxwell2 : public HIDDevice {
std::array<std::array<uint8_t, MSG_SIZE>, 6> status_buffs {};

// Send UNIQUE_REQUESTS packets
for (int i = 0; i < 15; ++i) {
auto result = sendGetInputReport(device_handle, UNIQUE_REQUESTS[i]);
for (const auto& unique_request : UNIQUE_REQUESTS) {
auto result = sendGetInputReport(device_handle, unique_request);
if (!result) {
return result.error();
}
Expand Down