Tidying
This commit is contained in:
@@ -35,7 +35,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::size_t getUsbHidInputReportSize() {
|
std::size_t getUsbHidInputReportSize() {
|
||||||
return this->usbHidInterface.getInputReportSize();
|
return this->usbHidInterface.inputReportSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setMinimumCommandTimeGap(std::chrono::milliseconds commandTimeGap) {
|
void setMinimumCommandTimeGap(std::chrono::milliseconds commandTimeGap) {
|
||||||
|
|||||||
@@ -75,18 +75,18 @@ namespace Bloom::Usb
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HidInterface::write(std::vector<unsigned char>&& buffer) {
|
void HidInterface::write(std::vector<unsigned char>&& buffer) {
|
||||||
if (buffer.size() > this->getInputReportSize()) {
|
if (buffer.size() > this->inputReportSize) {
|
||||||
throw DeviceCommunicationFailure(
|
throw DeviceCommunicationFailure(
|
||||||
"Cannot send data via HID interface - data exceeds maximum packet size."
|
"Cannot send data via HID interface - data exceeds maximum packet size."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffer.size() < this->getInputReportSize()) {
|
if (buffer.size() < this->inputReportSize) {
|
||||||
/*
|
/*
|
||||||
* Every report we send via the USB HID interface should be of a fixed size.
|
* Every report we send via the USB HID interface should be of a fixed size.
|
||||||
* In the event of a report being too small, we just fill the buffer vector with 0.
|
* In the event of a report being too small, we just fill the buffer vector with 0.
|
||||||
*/
|
*/
|
||||||
buffer.resize(this->getInputReportSize(), 0);
|
buffer.resize(this->inputReportSize, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int transferred = 0;
|
int transferred = 0;
|
||||||
|
|||||||
@@ -37,10 +37,6 @@ namespace Bloom::Usb
|
|||||||
HidInterface(HidInterface&& other) = default;
|
HidInterface(HidInterface&& other) = default;
|
||||||
HidInterface& operator = (HidInterface&& other) = default;
|
HidInterface& operator = (HidInterface&& other) = default;
|
||||||
|
|
||||||
std::size_t getInputReportSize() const {
|
|
||||||
return this->inputReportSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtains a hid_device instance and claims the HID interface on the device.
|
* Obtains a hid_device instance and claims the HID interface on the device.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user