Add raw send_bytes function

This commit is contained in:
Florian Jung 2021-03-28 19:37:32 +02:00
parent 57f69e3a7f
commit b06d1dcb50

View file

@ -47,7 +47,10 @@ impl<B: UsbBus> MidiClass<'_, B> {
}) })
} }
pub fn send_message(&mut self, usb_midi:UsbMidiEventPacket) -> Result<usize> { pub fn send_bytes(&mut self, buffer: [u8; 4]) -> Result<usize> {
self.standard_bulkin.write(&buffer)
}
pub fn send_message(&mut self, usb_midi: UsbMidiEventPacket) -> Result<usize> {
let bytes : [u8;MIDI_PACKET_SIZE] = usb_midi.into(); let bytes : [u8;MIDI_PACKET_SIZE] = usb_midi.into();
self.standard_bulkin.write(&bytes) self.standard_bulkin.write(&bytes)
} }