Implement DeviceType and icsneo_getProductName

This commit is contained in:
Paul Hollinsky
2018-09-26 20:43:49 -04:00
parent bbcc5b2d7b
commit 06b7181492
17 changed files with 83 additions and 43 deletions
+3 -2
View File
@@ -2,6 +2,7 @@
#define __RADSTAR2_H_
#include "device/include/device.h"
#include "device/include/devicetype.h"
#include "platform/include/ftdi.h"
namespace icsneo {
@@ -9,14 +10,14 @@ namespace icsneo {
class RADStar2 : public Device {
public:
// Serial numbers start with RS
static constexpr const char* PRODUCT_NAME = "RADStar 2";
static constexpr DeviceType::Enum DEVICE_TYPE = DeviceType::RADStar2;
static constexpr const uint16_t PRODUCT_ID = 0x0005;
RADStar2(neodevice_t neodevice) : Device(neodevice) {
auto transport = std::make_shared<FTDI>(getWritableNeoDevice());
auto packetizer = std::make_shared<Packetizer>();
auto decoder = std::make_shared<Decoder>();
com = std::make_shared<Communication>(transport, packetizer, decoder);
setProductName(PRODUCT_NAME);
getWritableNeoDevice().type = DEVICE_TYPE;
productId = PRODUCT_ID;
}