Add support for neoOBD2 PRO

pull/4/head
Paul Hollinsky 2018-09-18 16:35:22 -04:00
parent 63d13cdb88
commit 6d4652f03f
3 changed files with 36 additions and 0 deletions

View File

@ -4,6 +4,8 @@ Hardware
STM32 devices
ValueCAN 4
CAN 2.0 works
neoOBD2 PRO
CAN 2.0 works
FTDI devices
neoVI FIRE

View File

@ -1,4 +1,5 @@
#include "device/include/devicefinder.h"
#include "device/neoobd2pro/include/neoobd2pro.h"
#include "device/neovifire/include/neovifire.h"
#include "device/neovifire2/include/neovifire2.h"
#include "device/plasion/include/neoviion.h"
@ -15,6 +16,7 @@ std::vector<std::shared_ptr<Device>> DeviceFinder::FindAll() {
std::vector<std::shared_ptr<Device>> foundDevices;
std::vector<std::vector<std::shared_ptr<Device>>> findResults;
findResults.push_back(NeoOBD2PRO::Find());
findResults.push_back(NeoVIFIRE::Find());
findResults.push_back(NeoVIFIRE2::Find());
findResults.push_back(NeoVIION::Find());

View File

@ -0,0 +1,32 @@
#ifndef __NEOOBD2PRO_H_
#define __NEOOBD2PRO_H_
#include "device/include/device.h"
#include "platform/include/stm32.h"
namespace icsneo {
class NeoOBD2PRO : public Device {
public:
// Serial numbers are NP****
static constexpr const char* PRODUCT_NAME = "neoOBD2 PRO";
static constexpr const uint16_t USB_PRODUCT_ID = 0x1103;
NeoOBD2PRO(neodevice_t neodevice) : Device(neodevice) {
com = std::make_shared<Communication>(std::make_shared<STM32>(getWritableNeoDevice()));
setProductName(PRODUCT_NAME);
usbProductId = USB_PRODUCT_ID;
}
static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : STM32::FindByProduct(USB_PRODUCT_ID))
found.push_back(std::make_shared<NeoOBD2PRO>(neodevice));
return found;
}
};
};
#endif