Rename the USB_PRODUCT_ID to PRODUCT_ID as it is used for Ethernet as well

pull/4/head
Paul Hollinsky 2018-09-18 16:59:59 -04:00
parent 8343093708
commit b254ac991d
13 changed files with 38 additions and 38 deletions

View File

@ -27,7 +27,7 @@ public:
static bool SerialStringIsNumeric(const std::string& serial); static bool SerialStringIsNumeric(const std::string& serial);
std::string getProductName() const { return data.type; } std::string getProductName() const { return data.type; }
uint16_t getUSBProductId() const { return usbProductId; } uint16_t getProductId() const { return productId; }
std::string getSerial() const { return data.serial; } std::string getSerial() const { return data.serial; }
uint32_t getSerialNumber() const { return Device::SerialStringToNum(getSerial()); } uint32_t getSerialNumber() const { return Device::SerialStringToNum(getSerial()); }
const neodevice_t& getNeoDevice() const { return data; } const neodevice_t& getNeoDevice() const { return data; }
@ -51,7 +51,7 @@ public:
} }
protected: protected:
uint16_t usbProductId = 0; uint16_t productId = 0;
bool online = false; bool online = false;
int messagePollingCallbackID = 0; int messagePollingCallbackID = 0;
std::shared_ptr<Communication> com; std::shared_ptr<Communication> com;

View File

@ -10,17 +10,17 @@ class NeoOBD2PRO : public Device {
public: public:
// Serial numbers are NP**** // Serial numbers are NP****
static constexpr const char* PRODUCT_NAME = "neoOBD2 PRO"; static constexpr const char* PRODUCT_NAME = "neoOBD2 PRO";
static constexpr const uint16_t USB_PRODUCT_ID = 0x1103; static constexpr const uint16_t PRODUCT_ID = 0x1103;
NeoOBD2PRO(neodevice_t neodevice) : Device(neodevice) { NeoOBD2PRO(neodevice_t neodevice) : Device(neodevice) {
com = std::make_shared<Communication>(std::make_shared<STM32>(getWritableNeoDevice())); com = std::make_shared<Communication>(std::make_shared<STM32>(getWritableNeoDevice()));
setProductName(PRODUCT_NAME); setProductName(PRODUCT_NAME);
usbProductId = USB_PRODUCT_ID; productId = PRODUCT_ID;
} }
static std::vector<std::shared_ptr<Device>> Find() { static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found; std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : STM32::FindByProduct(USB_PRODUCT_ID)) for(auto neodevice : STM32::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<NeoOBD2PRO>(neodevice)); found.push_back(std::make_shared<NeoOBD2PRO>(neodevice));
return found; return found;

View File

@ -9,11 +9,11 @@ namespace icsneo {
class NeoVIFIRE : public Device { class NeoVIFIRE : public Device {
public: public:
static constexpr const char* PRODUCT_NAME = "neoVI FIRE"; static constexpr const char* PRODUCT_NAME = "neoVI FIRE";
static constexpr const uint16_t USB_PRODUCT_ID = 0x0701; static constexpr const uint16_t PRODUCT_ID = 0x0701;
NeoVIFIRE(neodevice_t neodevice) : Device(neodevice) { NeoVIFIRE(neodevice_t neodevice) : Device(neodevice) {
com = std::make_shared<Communication>(std::make_shared<FTDI>(getWritableNeoDevice())); com = std::make_shared<Communication>(std::make_shared<FTDI>(getWritableNeoDevice()));
setProductName(PRODUCT_NAME); setProductName(PRODUCT_NAME);
usbProductId = USB_PRODUCT_ID; productId = PRODUCT_ID;
} }
enum class Mode : char { enum class Mode : char {
@ -43,7 +43,7 @@ public:
static std::vector<std::shared_ptr<Device>> Find() { static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found; std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : FTDI::FindByProduct(USB_PRODUCT_ID)) for(auto neodevice : FTDI::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<NeoVIFIRE>(neodevice)); found.push_back(std::make_shared<NeoVIFIRE>(neodevice));
return found; return found;

View File

@ -8,16 +8,16 @@ namespace icsneo {
class NeoVIFIRE2ETH : public NeoVIFIRE2 { class NeoVIFIRE2ETH : public NeoVIFIRE2 {
public: public:
static constexpr const uint16_t USB_PRODUCT_ID = 0x0004; static constexpr const uint16_t PRODUCT_ID = 0x0004;
NeoVIFIRE2ETH(neodevice_t neodevice) : NeoVIFIRE2(neodevice) { NeoVIFIRE2ETH(neodevice_t neodevice) : NeoVIFIRE2(neodevice) {
com = std::make_shared<Communication>(std::make_shared<PCAP>(getWritableNeoDevice())); com = std::make_shared<Communication>(std::make_shared<PCAP>(getWritableNeoDevice()));
usbProductId = USB_PRODUCT_ID; productId = PRODUCT_ID;
} }
static std::vector<std::shared_ptr<Device>> Find() { static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found; std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : PCAP::FindByProduct(USB_PRODUCT_ID)) for(auto neodevice : PCAP::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<NeoVIFIRE2ETH>(neodevice)); found.push_back(std::make_shared<NeoVIFIRE2ETH>(neodevice));
return found; return found;

View File

@ -8,16 +8,16 @@ namespace icsneo {
class NeoVIFIRE2USB : public NeoVIFIRE2 { class NeoVIFIRE2USB : public NeoVIFIRE2 {
public: public:
static constexpr const uint16_t USB_PRODUCT_ID = 0x1000; static constexpr const uint16_t PRODUCT_ID = 0x1000;
NeoVIFIRE2USB(neodevice_t neodevice) : NeoVIFIRE2(neodevice) { NeoVIFIRE2USB(neodevice_t neodevice) : NeoVIFIRE2(neodevice) {
com = std::make_shared<Communication>(std::make_shared<FTDI>(getWritableNeoDevice())); com = std::make_shared<Communication>(std::make_shared<FTDI>(getWritableNeoDevice()));
usbProductId = USB_PRODUCT_ID; productId = PRODUCT_ID;
} }
static std::vector<std::shared_ptr<Device>> Find() { static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found; std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : FTDI::FindByProduct(USB_PRODUCT_ID)) for(auto neodevice : FTDI::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<NeoVIFIRE2USB>(neodevice)); found.push_back(std::make_shared<NeoVIFIRE2USB>(neodevice));
return found; return found;

View File

@ -9,16 +9,16 @@ namespace icsneo {
class NeoVIION : public Plasion { class NeoVIION : public Plasion {
public: public:
static constexpr const char* PRODUCT_NAME = "neoVI ION"; static constexpr const char* PRODUCT_NAME = "neoVI ION";
static constexpr const uint16_t USB_PRODUCT_ID = 0x0901; static constexpr const uint16_t PRODUCT_ID = 0x0901;
NeoVIION(neodevice_t neodevice) : Plasion(neodevice) { NeoVIION(neodevice_t neodevice) : Plasion(neodevice) {
setProductName(PRODUCT_NAME); setProductName(PRODUCT_NAME);
usbProductId = USB_PRODUCT_ID; productId = PRODUCT_ID;
} }
static std::vector<std::shared_ptr<Device>> Find() { static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found; std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : FTDI::FindByProduct(USB_PRODUCT_ID)) for(auto neodevice : FTDI::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<NeoVIION>(neodevice)); found.push_back(std::make_shared<NeoVIION>(neodevice));
return found; return found;

View File

@ -9,16 +9,16 @@ namespace icsneo {
class NeoVIPLASMA : public Plasion { class NeoVIPLASMA : public Plasion {
public: public:
static constexpr const char* PRODUCT_NAME = "neoVI PLASMA"; static constexpr const char* PRODUCT_NAME = "neoVI PLASMA";
static constexpr const uint16_t USB_PRODUCT_ID = 0x0801; static constexpr const uint16_t PRODUCT_ID = 0x0801;
NeoVIPLASMA(neodevice_t neodevice) : Plasion(neodevice) { NeoVIPLASMA(neodevice_t neodevice) : Plasion(neodevice) {
setProductName(PRODUCT_NAME); setProductName(PRODUCT_NAME);
usbProductId = USB_PRODUCT_ID; productId = PRODUCT_ID;
} }
static std::vector<std::shared_ptr<Device>> Find() { static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found; std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : FTDI::FindByProduct(USB_PRODUCT_ID)) for(auto neodevice : FTDI::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<NeoVIPLASMA>(neodevice)); found.push_back(std::make_shared<NeoVIPLASMA>(neodevice));
return found; return found;

View File

@ -10,17 +10,17 @@ class RADGalaxy : public Device {
public: public:
// Serial numbers start with RG // Serial numbers start with RG
static constexpr const char* PRODUCT_NAME = "RADGalaxy"; static constexpr const char* PRODUCT_NAME = "RADGalaxy";
static constexpr const uint16_t USB_PRODUCT_ID = 0x0003; static constexpr const uint16_t PRODUCT_ID = 0x0003;
RADGalaxy(neodevice_t neodevice) : Device(neodevice) { RADGalaxy(neodevice_t neodevice) : Device(neodevice) {
com = std::make_shared<Communication>(std::make_shared<PCAP>(getWritableNeoDevice())); com = std::make_shared<Communication>(std::make_shared<PCAP>(getWritableNeoDevice()));
setProductName(PRODUCT_NAME); setProductName(PRODUCT_NAME);
usbProductId = USB_PRODUCT_ID; productId = PRODUCT_ID;
} }
static std::vector<std::shared_ptr<Device>> Find() { static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found; std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : PCAP::FindByProduct(USB_PRODUCT_ID)) for(auto neodevice : PCAP::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<RADGalaxy>(neodevice)); found.push_back(std::make_shared<RADGalaxy>(neodevice));
return found; return found;

View File

@ -10,17 +10,17 @@ class RADStar2 : public Device {
public: public:
// Serial numbers start with RS // Serial numbers start with RS
static constexpr const char* PRODUCT_NAME = "RADStar 2"; static constexpr const char* PRODUCT_NAME = "RADStar 2";
static constexpr const uint16_t USB_PRODUCT_ID = 0x0005; static constexpr const uint16_t PRODUCT_ID = 0x0005;
RADStar2(neodevice_t neodevice) : Device(neodevice) { RADStar2(neodevice_t neodevice) : Device(neodevice) {
com = std::make_shared<Communication>(std::make_shared<FTDI>(getWritableNeoDevice())); com = std::make_shared<Communication>(std::make_shared<FTDI>(getWritableNeoDevice()));
setProductName(PRODUCT_NAME); setProductName(PRODUCT_NAME);
usbProductId = USB_PRODUCT_ID; productId = PRODUCT_ID;
} }
static std::vector<std::shared_ptr<Device>> Find() { static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found; std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : FTDI::FindByProduct(USB_PRODUCT_ID)) for(auto neodevice : FTDI::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<RADStar2>(neodevice)); found.push_back(std::make_shared<RADStar2>(neodevice));
return found; return found;

View File

@ -10,19 +10,19 @@ class RADSupermoon : public Device {
public: public:
// Serial numbers start with VV // Serial numbers start with VV
static constexpr const char* PRODUCT_NAME = "RADSupermoon"; static constexpr const char* PRODUCT_NAME = "RADSupermoon";
static constexpr const uint16_t USB_PRODUCT_ID = 0x1201; static constexpr const uint16_t PRODUCT_ID = 0x1201;
RADSupermoon(neodevice_t neodevice) : Device(neodevice) { RADSupermoon(neodevice_t neodevice) : Device(neodevice) {
com = std::make_shared<Communication>(std::make_shared<FTDI>(getWritableNeoDevice())); com = std::make_shared<Communication>(std::make_shared<FTDI>(getWritableNeoDevice()));
com->setAlign16Bit(false); com->setAlign16Bit(false);
setProductName(PRODUCT_NAME); setProductName(PRODUCT_NAME);
usbProductId = USB_PRODUCT_ID; productId = PRODUCT_ID;
} }
// RSM does not connect at all yet (needs FTDI D3xx driver, not the 2xx compatible one) // RSM does not connect at all yet (needs FTDI D3xx driver, not the 2xx compatible one)
static std::vector<std::shared_ptr<Device>> Find() { static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found; std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : FTDI::FindByProduct(USB_PRODUCT_ID)) for(auto neodevice : FTDI::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<RADSupermoon>(neodevice)); found.push_back(std::make_shared<RADSupermoon>(neodevice));
return found; return found;

View File

@ -9,17 +9,17 @@ namespace icsneo {
class ValueCAN3 : public Device { class ValueCAN3 : public Device {
public: public:
static constexpr const char* PRODUCT_NAME = "ValueCAN 3"; static constexpr const char* PRODUCT_NAME = "ValueCAN 3";
static constexpr const uint16_t USB_PRODUCT_ID = 0x0601; static constexpr const uint16_t PRODUCT_ID = 0x0601;
ValueCAN3(neodevice_t neodevice) : Device(neodevice) { ValueCAN3(neodevice_t neodevice) : Device(neodevice) {
com = std::make_shared<Communication>(std::make_shared<FTDI>(getWritableNeoDevice())); com = std::make_shared<Communication>(std::make_shared<FTDI>(getWritableNeoDevice()));
setProductName(PRODUCT_NAME); setProductName(PRODUCT_NAME);
usbProductId = USB_PRODUCT_ID; productId = PRODUCT_ID;
} }
static std::vector<std::shared_ptr<Device>> Find() { static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found; std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : FTDI::FindByProduct(USB_PRODUCT_ID)) for(auto neodevice : FTDI::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<ValueCAN3>(neodevice)); found.push_back(std::make_shared<ValueCAN3>(neodevice));
return found; return found;

View File

@ -10,17 +10,17 @@ class ValueCAN4 : public Device {
public: public:
// Serial numbers are V0 for 4-4, VE for 4-2EL, V2 for 4-2, and V1 for 4-1 // Serial numbers are V0 for 4-4, VE for 4-2EL, V2 for 4-2, and V1 for 4-1
static constexpr const char* PRODUCT_NAME = "ValueCAN 4"; static constexpr const char* PRODUCT_NAME = "ValueCAN 4";
static constexpr const uint16_t USB_PRODUCT_ID = 0x1101; static constexpr const uint16_t PRODUCT_ID = 0x1101;
ValueCAN4(neodevice_t neodevice) : Device(neodevice) { ValueCAN4(neodevice_t neodevice) : Device(neodevice) {
com = std::make_shared<Communication>(std::make_shared<STM32>(getWritableNeoDevice())); com = std::make_shared<Communication>(std::make_shared<STM32>(getWritableNeoDevice()));
setProductName(PRODUCT_NAME); setProductName(PRODUCT_NAME);
usbProductId = USB_PRODUCT_ID; productId = PRODUCT_ID;
} }
static std::vector<std::shared_ptr<Device>> Find() { static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found; std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : STM32::FindByProduct(USB_PRODUCT_ID)) for(auto neodevice : STM32::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<ValueCAN4>(neodevice)); found.push_back(std::make_shared<ValueCAN4>(neodevice));
return found; return found;

View File

@ -10,11 +10,11 @@ class VividCAN : public Device {
public: public:
// Serial numbers start with VV // Serial numbers start with VV
static constexpr const char* PRODUCT_NAME = "VividCAN"; static constexpr const char* PRODUCT_NAME = "VividCAN";
static constexpr const uint16_t USB_PRODUCT_ID = 0x1102; static constexpr const uint16_t PRODUCT_ID = 0x1102;
VividCAN(neodevice_t neodevice) : Device(neodevice) { VividCAN(neodevice_t neodevice) : Device(neodevice) {
com = std::make_shared<Communication>(std::make_shared<STM32>(getWritableNeoDevice())); com = std::make_shared<Communication>(std::make_shared<STM32>(getWritableNeoDevice()));
setProductName(PRODUCT_NAME); setProductName(PRODUCT_NAME);
usbProductId = USB_PRODUCT_ID; productId = PRODUCT_ID;
} }
bool goOnline() { return false; } bool goOnline() { return false; }
@ -22,7 +22,7 @@ public:
static std::vector<std::shared_ptr<Device>> Find() { static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found; std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : STM32::FindByProduct(USB_PRODUCT_ID)) for(auto neodevice : STM32::FindByProduct(PRODUCT_ID))
found.push_back(std::make_shared<VividCAN>(neodevice)); found.push_back(std::make_shared<VividCAN>(neodevice));
return found; return found;