mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Some final tidying.
This commit is contained in:
@@ -42,7 +42,10 @@ std::vector<std::shared_ptr<CandidateDevice>> findUsbDevices()
|
||||
{
|
||||
libusbp::serial_port port(candidate->device);
|
||||
candidate->serialPort = port.get_name();
|
||||
candidate->type = DEVICE_GREASEWEAZLE;
|
||||
}
|
||||
else if (id == FLUXENGINE_ID)
|
||||
candidate->type = DEVICE_FLUXENGINE;
|
||||
|
||||
candidates.push_back(std::move(candidate));
|
||||
}
|
||||
@@ -50,3 +53,19 @@ std::vector<std::shared_ptr<CandidateDevice>> findUsbDevices()
|
||||
|
||||
return candidates;
|
||||
}
|
||||
|
||||
std::string getDeviceName(DeviceType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DEVICE_GREASEWEAZLE:
|
||||
return "Greaseweazle";
|
||||
|
||||
case DEVICE_FLUXENGINE:
|
||||
return "FluxEngine";
|
||||
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,17 @@
|
||||
#include "libusbp_config.h"
|
||||
#include "libusbp.hpp"
|
||||
|
||||
enum DeviceType
|
||||
{
|
||||
DEVICE_FLUXENGINE,
|
||||
DEVICE_GREASEWEAZLE
|
||||
};
|
||||
|
||||
extern std::string getDeviceName(DeviceType type);
|
||||
|
||||
struct CandidateDevice
|
||||
{
|
||||
DeviceType type;
|
||||
libusbp::device device;
|
||||
uint32_t id;
|
||||
std::string serial;
|
||||
|
||||
Reference in New Issue
Block a user