From dd71bcaeb07283385e026c57fd2617f4ab3b279f Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 13 Apr 2021 00:38:12 +0200 Subject: [PATCH] Corrected expected total descriptor length --- Cargo.toml | 2 +- src/midi_device.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ba8516a..604be9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "usbd-midi" version = "0.2.0" -authors = ["beau trepp "] +authors = ["beau trepp ", "Florian Jung "] edition = "2018" description = "A usb-midi implementation for usb-device" homepage = "https://github.com/btrepp/usbd-midi" diff --git a/src/midi_device.rs b/src/midi_device.rs index 5baa24d..60a9761 100644 --- a/src/midi_device.rs +++ b/src/midi_device.rs @@ -117,7 +117,7 @@ impl UsbClass for MidiClass<'_, B> { let midi_streaming_start_byte = writer.position(); let midi_streaming_total_length = 7 + (self.n_in_jacks + self.n_out_jacks) as usize * (MIDI_IN_SIZE + MIDI_OUT_SIZE) as usize - + 9 + (4+self.n_out_jacks as usize) + 9 + (4+self.n_in_jacks as usize); + + 7 + (4+self.n_out_jacks as usize) + 7 + (4+self.n_in_jacks as usize); //Streaming extra info writer.write( // len = 7 @@ -190,7 +190,7 @@ impl UsbClass for MidiClass<'_, B> { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 // jack mappings. must be filled in and cropped. ]; - writer.endpoint(&self.standard_bulkout)?; // len = 9 + writer.endpoint(&self.standard_bulkout)?; // len = 7 endpoint_data[1] = self.n_out_jacks; for i in 0..self.n_out_jacks { @@ -201,7 +201,7 @@ impl UsbClass for MidiClass<'_, B> { &endpoint_data[0..2+self.n_out_jacks as usize] )?; - writer.endpoint(&self.standard_bulkin)?; // len = 9 + writer.endpoint(&self.standard_bulkin)?; // len = 7 endpoint_data[1] = self.n_in_jacks; for i in 0..self.n_in_jacks { endpoint_data[2 + i as usize] = self.out_jack_id_emb(i);