Device: Add RADMoon2ZL
Also adds a base class for both Moon2 device types.pull/56/head
parent
73744bf6d9
commit
bbf348a6ab
|
|
@ -185,6 +185,10 @@ std::vector<std::shared_ptr<Device>> DeviceFinder::FindAll() {
|
||||||
makeIfSerialMatches<RADMoon2>(dev, newFoundDevices);
|
makeIfSerialMatches<RADMoon2>(dev, newFoundDevices);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __RADMOON2ZL_H_
|
||||||
|
makeIfSerialMatches<RADMoon2ZL>(dev, newFoundDevices);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __RADMOON3_H_
|
#ifdef __RADMOON3_H_
|
||||||
makeIfSerialMatches<RADMoon3>(dev, newFoundDevices);
|
makeIfSerialMatches<RADMoon3>(dev, newFoundDevices);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -312,7 +316,7 @@ const std::vector<DeviceType>& DeviceFinder::GetSupportedDevices() {
|
||||||
RADGigastar::DEVICE_TYPE,
|
RADGigastar::DEVICE_TYPE,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __RADMOON2_H_
|
#if defined __RADMOON2_H_ || defined __RADMOON2ZL_H_
|
||||||
RADMoon2::DEVICE_TYPE,
|
RADMoon2::DEVICE_TYPE,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,9 @@ typedef struct OP_ETH_SETTINGS_t
|
||||||
unsigned char mac_addr2[6];// Target Addr for spoofing
|
unsigned char mac_addr2[6];// Target Addr for spoofing
|
||||||
unsigned short mac_spoofing_en : 1;
|
unsigned short mac_spoofing_en : 1;
|
||||||
unsigned short mac_spoofing_isDstOrSrc : 1;
|
unsigned short mac_spoofing_isDstOrSrc : 1;
|
||||||
unsigned short reserved : 14;
|
unsigned short link_spd : 2;
|
||||||
|
unsigned short q2112_phy_mode : 1;
|
||||||
|
unsigned short reserved : 11;
|
||||||
};
|
};
|
||||||
unsigned char reserved0[14];
|
unsigned char reserved0[14];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,91 +3,33 @@
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
#include "icsneo/device/device.h"
|
#include "icsneo/device/tree/radmoon2/radmoon2base.h"
|
||||||
#include "icsneo/device/devicetype.h"
|
|
||||||
#include "icsneo/device/tree/radmoon2/radmoon2settings.h"
|
#include "icsneo/device/tree/radmoon2/radmoon2settings.h"
|
||||||
|
|
||||||
namespace icsneo {
|
namespace icsneo {
|
||||||
|
|
||||||
class RADMoon2 : public Device {
|
class RADMoon2 : public RADMoon2Base {
|
||||||
public:
|
public:
|
||||||
// Serial numbers start with RM
|
// Serial numbers start with RM
|
||||||
// USB PID is 0x1202, standard driver is FTDI3
|
// USB PID is 0x1202, standard driver is FTDI3
|
||||||
ICSNEO_FINDABLE_DEVICE(RADMoon2, DeviceType::RADMoon2, "RM");
|
ICSNEO_FINDABLE_DEVICE(RADMoon2, DeviceType::RADMoon2, "RM");
|
||||||
|
|
||||||
enum class SKU {
|
uint8_t getPhyAddrOrPort() const override { return 6; };
|
||||||
Standard,
|
|
||||||
APM1000E, // Keysight Branding
|
|
||||||
APM1000E_CLK, // Clock Option and Keysight Branding
|
|
||||||
};
|
|
||||||
|
|
||||||
SKU getSKU() const {
|
|
||||||
switch(getSerial().back()) {
|
|
||||||
case 'A':
|
|
||||||
case 'B':
|
|
||||||
return SKU::APM1000E;
|
|
||||||
case 'C':
|
|
||||||
case 'D':
|
|
||||||
return SKU::APM1000E_CLK;
|
|
||||||
default:
|
|
||||||
return SKU::Standard;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string getProductName() const override {
|
|
||||||
switch(getSKU()) {
|
|
||||||
case SKU::Standard: break;
|
|
||||||
case SKU::APM1000E:
|
|
||||||
return "Keysight APM1000E";
|
|
||||||
case SKU::APM1000E_CLK:
|
|
||||||
return "Keysight APM1000E-CLK";
|
|
||||||
}
|
|
||||||
return Device::getProductName();
|
|
||||||
}
|
|
||||||
|
|
||||||
// RADMoon 2 does not go online, you can only set settings and
|
|
||||||
// view PHY information (when supported)
|
|
||||||
bool goOnline() override {
|
|
||||||
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool goOffline() override {
|
|
||||||
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool getEthPhyRegControlSupported() const override { return true; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
RADMoon2(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
RADMoon2(neodevice_t neodevice, const driver_factory_t& makeDriver) : RADMoon2Base(neodevice) {
|
||||||
initialize<RADMoon2Settings>(makeDriver);
|
initialize<RADMoon2Settings>(makeDriver);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupPacketizer(Packetizer& packetizer) override {
|
|
||||||
Device::setupPacketizer(packetizer);
|
|
||||||
packetizer.disableChecksum = true;
|
|
||||||
packetizer.align16bit = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void setupEncoder(Encoder& encoder) override {
|
|
||||||
Device::setupEncoder(encoder);
|
|
||||||
encoder.supportEthPhy = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setupDecoder(Decoder& decoder) override {
|
void setupDecoder(Decoder& decoder) override {
|
||||||
Device::setupDecoder(decoder);
|
Device::setupDecoder(decoder);
|
||||||
decoder.timestampResolution = 10; // Timestamps are in 10ns increments instead of the usual 25ns
|
decoder.timestampResolution = 10; // Timestamps are in 10ns increments instead of the usual 25ns
|
||||||
}
|
}
|
||||||
|
|
||||||
bool requiresVehiclePower() const override { return false; }
|
void setupPacketizer(Packetizer& packetizer) override {
|
||||||
|
Device::setupPacketizer(packetizer);
|
||||||
std::optional<MemoryAddress> getCoreminiStartAddressFlash() const override {
|
packetizer.disableChecksum = true;
|
||||||
return 512*4;
|
packetizer.align16bit = false;
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<MemoryAddress> getCoreminiStartAddressSD() const override {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
#ifndef __RADMOON2BASE_H_
|
||||||
|
#define __RADMOON2BASE_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
#include "icsneo/device/device.h"
|
||||||
|
#include "icsneo/device/devicetype.h"
|
||||||
|
|
||||||
|
namespace icsneo {
|
||||||
|
|
||||||
|
class RADMoon2Base : public Device {
|
||||||
|
public:
|
||||||
|
enum class SKU {
|
||||||
|
Standard,
|
||||||
|
APM1000E, // Keysight Branding
|
||||||
|
APM1000E_CLK, // Clock Option and Keysight Branding
|
||||||
|
};
|
||||||
|
|
||||||
|
SKU getSKU() const {
|
||||||
|
switch(getSerial().back()) {
|
||||||
|
case 'A':
|
||||||
|
case 'B':
|
||||||
|
return SKU::APM1000E;
|
||||||
|
case 'C':
|
||||||
|
case 'D':
|
||||||
|
return SKU::APM1000E_CLK;
|
||||||
|
default:
|
||||||
|
return SKU::Standard;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getProductName() const override {
|
||||||
|
switch(getSKU()) {
|
||||||
|
case SKU::Standard: break;
|
||||||
|
case SKU::APM1000E:
|
||||||
|
return "Keysight APM1000E";
|
||||||
|
case SKU::APM1000E_CLK:
|
||||||
|
return "Keysight APM1000E-CLK";
|
||||||
|
}
|
||||||
|
return Device::getProductName();
|
||||||
|
}
|
||||||
|
|
||||||
|
// RADMoon 2 does not go online, you can only set settings and
|
||||||
|
// view PHY information (when supported)
|
||||||
|
bool goOnline() override {
|
||||||
|
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool goOffline() override {
|
||||||
|
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool getEthPhyRegControlSupported() const override { return true; }
|
||||||
|
|
||||||
|
virtual uint8_t getPhyAddrOrPort() const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
using Device::Device;
|
||||||
|
|
||||||
|
virtual void setupEncoder(Encoder& encoder) override {
|
||||||
|
Device::setupEncoder(encoder);
|
||||||
|
encoder.supportEthPhy = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool requiresVehiclePower() const override { return false; }
|
||||||
|
|
||||||
|
std::optional<MemoryAddress> getCoreminiStartAddressFlash() const override {
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::optional<MemoryAddress> getCoreminiStartAddressSD() const override {
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
#ifndef __RADMOON2ZL_H_
|
||||||
|
#define __RADMOON2ZL_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
#include "icsneo/device/tree/radmoon2/radmoon2base.h"
|
||||||
|
#include "icsneo/device/tree/radmoon2/radmoon2settings.h"
|
||||||
|
|
||||||
|
namespace icsneo {
|
||||||
|
|
||||||
|
class RADMoon2ZL : public RADMoon2Base {
|
||||||
|
public:
|
||||||
|
// Serial numbers start with RN
|
||||||
|
// USB PID is 0x110C, standard driver is CDCACM
|
||||||
|
ICSNEO_FINDABLE_DEVICE(RADMoon2ZL, DeviceType::RADMoon2, "RN");
|
||||||
|
|
||||||
|
uint8_t getPhyAddrOrPort() const override { return 1; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
RADMoon2ZL(neodevice_t neodevice, const driver_factory_t& makeDriver) : RADMoon2Base(neodevice) {
|
||||||
|
initialize<RADMoon2Settings>(makeDriver);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -944,7 +944,9 @@ typedef struct OP_ETH_SETTINGS_t
|
||||||
unsigned char mac_addr2[6];// Target Addr for spoofing
|
unsigned char mac_addr2[6];// Target Addr for spoofing
|
||||||
unsigned short mac_spoofing_en : 1;
|
unsigned short mac_spoofing_en : 1;
|
||||||
unsigned short mac_spoofing_isDstOrSrc : 1;
|
unsigned short mac_spoofing_isDstOrSrc : 1;
|
||||||
unsigned short reserved : 14;
|
unsigned short link_spd : 2;
|
||||||
|
unsigned short q2112_phy_mode : 1;
|
||||||
|
unsigned short reserved : 11;
|
||||||
};
|
};
|
||||||
unsigned char reserved0[14];
|
unsigned char reserved0[14];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
#include "icsneo/device/tree/radjupiter/radjupiter.h"
|
#include "icsneo/device/tree/radjupiter/radjupiter.h"
|
||||||
#include "icsneo/device/tree/radmars/radmars.h"
|
#include "icsneo/device/tree/radmars/radmars.h"
|
||||||
#include "icsneo/device/tree/radmoon2/radmoon2.h"
|
#include "icsneo/device/tree/radmoon2/radmoon2.h"
|
||||||
|
#include "icsneo/device/tree/radmoon2/radmoon2zl.h"
|
||||||
#include "icsneo/device/tree/radmoon3/radmoon3.h"
|
#include "icsneo/device/tree/radmoon3/radmoon3.h"
|
||||||
#include "icsneo/device/tree/radmoonduo/radmoonduo.h"
|
#include "icsneo/device/tree/radmoonduo/radmoonduo.h"
|
||||||
#include "icsneo/device/tree/radpluto/radpluto.h"
|
#include "icsneo/device/tree/radpluto/radpluto.h"
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
#include "icsneo/device/tree/radjupiter/radjupiter.h"
|
#include "icsneo/device/tree/radjupiter/radjupiter.h"
|
||||||
#include "icsneo/device/tree/radmars/radmars.h"
|
#include "icsneo/device/tree/radmars/radmars.h"
|
||||||
#include "icsneo/device/tree/radmoon2/radmoon2.h"
|
#include "icsneo/device/tree/radmoon2/radmoon2.h"
|
||||||
|
#include "icsneo/device/tree/radmoon2/radmoon2zl.h"
|
||||||
#include "icsneo/device/tree/radmoon3/radmoon3.h"
|
#include "icsneo/device/tree/radmoon3/radmoon3.h"
|
||||||
#include "icsneo/device/tree/radmoonduo/radmoonduo.h"
|
#include "icsneo/device/tree/radmoonduo/radmoonduo.h"
|
||||||
#include "icsneo/device/tree/radpluto/radpluto.h"
|
#include "icsneo/device/tree/radpluto/radpluto.h"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue