Refactored UsbInterface::writeBulk member function to use std::span instead of std::vector
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include <span>
|
||||
#include <optional>
|
||||
#include <chrono>
|
||||
|
||||
@@ -43,7 +44,11 @@ namespace Usb
|
||||
std::optional<std::chrono::milliseconds> timeout = std::nullopt
|
||||
);
|
||||
|
||||
void writeBulk(std::uint8_t endpointAddress, std::vector<unsigned char>&& buffer);
|
||||
void writeBulk(
|
||||
std::uint8_t endpointAddress,
|
||||
std::span<const unsigned char> buffer,
|
||||
std::uint16_t maxPacketSize
|
||||
);
|
||||
|
||||
private:
|
||||
::libusb_device_handle* deviceHandle;
|
||||
|
||||
Reference in New Issue
Block a user