General tidying, addressing issues found by static analysis tool.
This commit is contained in:
@@ -65,7 +65,7 @@ namespace Bloom::Usb
|
||||
}
|
||||
|
||||
public:
|
||||
std::size_t getInputReportSize() {
|
||||
std::size_t getInputReportSize() const {
|
||||
return this->inputReportSize;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
*
|
||||
* https://github.com/signal11/hidapi
|
||||
*/
|
||||
struct hid_device_ {
|
||||
struct hid_device_
|
||||
{
|
||||
// Handle to the actual device.
|
||||
libusb_device_handle* device_handle;
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#include <libusb-1.0/libusb.h>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
|
||||
#include "Interface.hpp"
|
||||
#include "src/Logger/Logger.hpp"
|
||||
#include "src/Exceptions/Exception.hpp"
|
||||
|
||||
using namespace Bloom::Usb;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Bloom::Usb
|
||||
std::uint16_t productId = 0;
|
||||
|
||||
std::uint8_t number = 0;
|
||||
std::string name = "";
|
||||
std::string name;
|
||||
|
||||
bool initialised = false;
|
||||
bool claimed = false;
|
||||
@@ -52,11 +52,11 @@ namespace Bloom::Usb
|
||||
this->name = name;
|
||||
}
|
||||
|
||||
bool isClaimed() {
|
||||
bool isClaimed() const {
|
||||
return this->claimed;
|
||||
}
|
||||
|
||||
bool isInitialised() {
|
||||
bool isInitialised() const {
|
||||
return this->initialised;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,6 @@ namespace Bloom::Usb
|
||||
void close();
|
||||
|
||||
public:
|
||||
void init();
|
||||
|
||||
UsbDevice(std::uint16_t vendorId, std::uint16_t productId) {
|
||||
this->vendorId = vendorId;
|
||||
this->productId = productId;
|
||||
@@ -35,6 +33,8 @@ namespace Bloom::Usb
|
||||
|
||||
~UsbDevice() = default;
|
||||
|
||||
void init();
|
||||
|
||||
[[nodiscard]] libusb_device* getLibUsbDevice() const {
|
||||
return this->libUsbDevice;
|
||||
}
|
||||
@@ -43,11 +43,11 @@ namespace Bloom::Usb
|
||||
this->libUsbDevice = libUsbDevice;
|
||||
}
|
||||
|
||||
std::uint16_t getVendorId() const {
|
||||
[[nodiscard]] std::uint16_t getVendorId() const {
|
||||
return this->vendorId;
|
||||
}
|
||||
|
||||
std::uint16_t getProductId() const {
|
||||
[[nodiscard]] std::uint16_t getProductId() const {
|
||||
return this->productId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user