RAD-Gigalog: Rename to RAD-Mars

v0.3.0-dev
Paul Hollinsky 2022-03-11 10:53:05 -05:00
parent f4e16025c1
commit 0ff12300f3
9 changed files with 51 additions and 51 deletions

View File

@ -51,12 +51,12 @@ static std::vector<DeviceType> supportedDevices = {
RADGalaxy::DEVICE_TYPE,
#endif
#ifdef __RADGIGALOG_ETH_H_
RADGigalogETH::DEVICE_TYPE,
#ifdef __RADMARS_ETH_H_
RADMarsETH::DEVICE_TYPE,
#endif
#ifdef __RADGIGALOG_USB_H_
RADGigalogUSB::DEVICE_TYPE,
#ifdef __RADMARS_USB_H_
RADMarsUSB::DEVICE_TYPE,
#endif
#ifdef __RADGIGASTAR_ETH_H_
@ -181,12 +181,12 @@ std::vector<std::shared_ptr<Device>> DeviceFinder::FindAll() {
findResults.push_back(RADGalaxy::Find(pcapDevices));
#endif
#ifdef __RADGIGALOG_ETH_H_
findResults.push_back(RADGigalogETH::Find(pcapDevices));
#ifdef __RADMARS_ETH_H_
findResults.push_back(RADMarsETH::Find(pcapDevices));
#endif
#ifdef __RADGIGALOG_USB_H_
findResults.push_back(RADGigalogUSB::Find());
#ifdef __RADMARS_USB_H_
findResults.push_back(RADMarsUSB::Find());
#endif
#ifdef __RADGIGASTAR_ETH_H_

View File

@ -23,7 +23,7 @@ public:
std::vector<std::shared_ptr<Packet>> output();
bool disableChecksum = false; // Even for short packets
bool align16bit = true; // Not needed for Gigalog, Galaxy, etc and newer
bool align16bit = true; // Not needed for Mars, Galaxy, etc and newer
private:
enum class ReadState {

View File

@ -29,7 +29,7 @@ public:
RADSupermoon = (0x00000003),
DW_VCAN = (0x00000004),
RADMoon2 = (0x00000005),
RADGigalog = (0x00000006),
RADMars = (0x00000006),
VCAN4_1 = (0x00000007),
FIRE = (0x00000008),
RADPluto = (0x00000009),
@ -95,8 +95,8 @@ public:
return "DW_VCAN";
case RADMoon2:
return "RAD-Moon 2";
case RADGigalog:
return "RAD-Gigalog";
case RADMars:
return "RAD-Mars";
case VCAN4_1:
return "ValueCAN 4-1";
case FIRE:
@ -203,7 +203,7 @@ private:
#define ICSNEO_DEVICETYPE_RADSUPERMOON ((devicetype_t)0x00000003)
#define ICSNEO_DEVICETYPE_DW_VCAN ((devicetype_t)0x00000004)
#define ICSNEO_DEVICETYPE_RADMOON2 ((devicetype_t)0x00000005)
#define ICSNEO_DEVICETYPE_RADGIGALOG ((devicetype_t)0x00000006)
#define ICSNEO_DEVICETYPE_RADMARS ((devicetype_t)0x00000006)
#define ICSNEO_DEVICETYPE_VCAN4_1 ((devicetype_t)0x00000007)
#define ICSNEO_DEVICETYPE_FIRE ((devicetype_t)0x00000008)
#define ICSNEO_DEVICETYPE_RADPLUTO ((devicetype_t)0x00000009)

View File

@ -1,23 +1,23 @@
#ifndef __RADGIGALOG_H_
#define __RADGIGALOG_H_
#ifndef __RADMARS_H_
#define __RADMARS_H_
#ifdef __cplusplus
#include "icsneo/device/device.h"
#include "icsneo/device/devicetype.h"
#include "icsneo/device/tree/radgigalog/radgigalogsettings.h"
#include "icsneo/device/tree/radmars/radmarssettings.h"
namespace icsneo {
class RADGigalog : public Device {
class RADMars : public Device {
public:
static constexpr DeviceType::Enum DEVICE_TYPE = DeviceType::RADGigalog;
static constexpr DeviceType::Enum DEVICE_TYPE = DeviceType::RADMars;
static constexpr const char* SERIAL_START = "GL";
size_t getEthernetActivationLineCount() const override { return 1; }
protected:
RADGigalog(neodevice_t neodevice) : Device(neodevice) {
RADMars(neodevice_t neodevice) : Device(neodevice) {
getWritableNeoDevice().type = DEVICE_TYPE;
}
@ -78,10 +78,10 @@ protected:
}
void handleDeviceStatus(const std::shared_ptr<RawMessage>& message) override {
if(message->data.size() < sizeof(radgigalog_status_t))
if(message->data.size() < sizeof(radmars_status_t))
return;
std::lock_guard<std::mutex> lk(ioMutex);
const radgigalog_status_t* status = reinterpret_cast<const radgigalog_status_t*>(message->data.data());
const radmars_status_t* status = reinterpret_cast<const radmars_status_t*>(message->data.data());
ethActivationStatus = status->ethernetActivationLineEnabled;
}
};

View File

@ -1,21 +1,21 @@
#ifndef __RADGIGALOG_ETH_H_
#define __RADGIGALOG_ETH_H_
#ifndef __RADMARS_ETH_H_
#define __RADMARS_ETH_H_
#ifdef __cplusplus
#include "icsneo/device/tree/radgigalog/radgigalog.h"
#include "icsneo/device/tree/radmars/radmars.h"
#include "icsneo/platform/pcap.h"
namespace icsneo {
class RADGigalogETH : public RADGigalog {
class RADMarsETH : public RADMars {
public:
static constexpr const uint16_t PRODUCT_ID = 0x000A;
static std::vector<std::shared_ptr<Device>> Find(const std::vector<PCAP::PCAPFoundDevice>& pcapDevices) {
std::vector<std::shared_ptr<Device>> found;
for(auto& foundDev : pcapDevices) {
auto fakedev = std::shared_ptr<RADGigalogETH>(new RADGigalogETH({}));
auto fakedev = std::shared_ptr<RADMarsETH>(new RADMarsETH({}));
for (auto& payload : foundDev.discoveryPackets)
fakedev->com->packetizer->input(payload);
for (auto& packet : fakedev->com->packetizer->output()) {
@ -32,11 +32,11 @@ public:
if(sn->deviceSerial.length() < 2)
continue;
if(sn->deviceSerial.substr(0, 2) != SERIAL_START)
continue; // Not a RADGigalog
continue; // Not a RAD-Mars
auto device = foundDev.device;
device.serial[sn->deviceSerial.copy(device.serial, sizeof(device.serial))] = '\0';
found.push_back(std::shared_ptr<RADGigalogETH>(new RADGigalogETH(std::move(device))));
found.push_back(std::shared_ptr<RADMarsETH>(new RADMarsETH(std::move(device))));
break;
}
}
@ -45,8 +45,8 @@ public:
}
private:
RADGigalogETH(neodevice_t neodevice) : RADGigalog(neodevice) {
initialize<PCAP, RADGigalogSettings>();
RADMarsETH(neodevice_t neodevice) : RADMars(neodevice) {
initialize<PCAP, RADMarsSettings>();
productId = PRODUCT_ID;
}
};

View File

@ -1,5 +1,5 @@
#ifndef __RADGIGALOGSETTINGS_H_
#define __RADGIGALOGSETTINGS_H_
#ifndef __RADMARSSETTINGS_H_
#define __RADMARSSETTINGS_H_
#include <stdint.h>
#include "icsneo/device/idevicesettings.h"
@ -85,25 +85,25 @@ typedef struct {
ETHERNET_SETTINGS2 ethernet2;
uint16_t network_enables_4;
RAD_REPORTING_SETTINGS reporting;
} radgigalog_settings_t;
} radmars_settings_t;
typedef struct {
uint8_t unused[3];
uint8_t ethernetActivationLineEnabled;
} radgigalog_status_t;
} radmars_status_t;
#pragma pack(pop)
#ifdef __cplusplus
static_assert(sizeof(radgigalog_settings_t) == 666, "RADGigalog settings size mismatch");
static_assert(sizeof(radmars_settings_t) == 666, "RAD-Mars settings size mismatch");
#include <iostream>
class RADGigalogSettings : public IDeviceSettings {
class RADMarsSettings : public IDeviceSettings {
public:
RADGigalogSettings(std::shared_ptr<Communication> com) : IDeviceSettings(com, sizeof(radgigalog_settings_t)) {}
RADMarsSettings(std::shared_ptr<Communication> com) : IDeviceSettings(com, sizeof(radmars_settings_t)) {}
const CAN_SETTINGS* getCANSettingsFor(Network net) const override {
auto cfg = getStructurePointer<radgigalog_settings_t>();
auto cfg = getStructurePointer<radmars_settings_t>();
if(cfg == nullptr)
return nullptr;
switch(net.getNetID()) {
@ -128,7 +128,7 @@ public:
}
}
const CANFD_SETTINGS* getCANFDSettingsFor(Network net) const override {
auto cfg = getStructurePointer<radgigalog_settings_t>();
auto cfg = getStructurePointer<radmars_settings_t>();
if(cfg == nullptr)
return nullptr;
switch(net.getNetID()) {
@ -172,7 +172,7 @@ public:
protected:
ICSNEO_UNALIGNED(const uint64_t*) getTerminationEnables() const override {
auto cfg = getStructurePointer<radgigalog_settings_t>();
auto cfg = getStructurePointer<radmars_settings_t>();
if(cfg == nullptr)
return nullptr;
return &cfg->termination_enables;

View File

@ -1,28 +1,28 @@
#ifndef __RADGIGALOG_USB_H_
#define __RADGIGALOG_USB_H_
#ifndef __RADMARS_USB_H_
#define __RADMARS_USB_H_
#ifdef __cplusplus
#include "icsneo/device/tree/radgigalog/radgigalog.h"
#include "icsneo/device/tree/radmars/radmars.h"
#include "icsneo/platform/ftdi3.h"
namespace icsneo {
class RADGigalogUSB : public RADGigalog {
class RADMarsUSB : public RADMars {
public:
static constexpr const uint16_t PRODUCT_ID = 0x1203;
static std::vector<std::shared_ptr<Device>> Find() {
std::vector<std::shared_ptr<Device>> found;
for(auto neodevice : FTDI3::FindByProduct(PRODUCT_ID))
found.emplace_back(new RADGigalogUSB(neodevice)); // Creation of the shared_ptr
found.emplace_back(new RADMarsUSB(neodevice)); // Creation of the shared_ptr
return found;
}
private:
RADGigalogUSB(neodevice_t neodevice) : RADGigalog(neodevice) {
initialize<FTDI3, RADGigalogSettings>();
RADMarsUSB(neodevice_t neodevice) : RADMars(neodevice) {
initialize<FTDI3, RADMarsSettings>();
productId = PRODUCT_ID;
}
};

View File

@ -12,10 +12,10 @@
#include "icsneo/device/tree/plasion/neoviplasma.h"
#include "icsneo/device/tree/radepsilon/radepsilon.h"
#include "icsneo/device/tree/radgalaxy/radgalaxy.h"
#include "icsneo/device/tree/radgigalog/radgigalogeth.h"
#include "icsneo/device/tree/radgigalog/radgigalogusb.h"
#include "icsneo/device/tree/radgigastar/radgigastareth.h"
#include "icsneo/device/tree/radgigastar/radgigastarusb.h"
#include "icsneo/device/tree/radmars/radmarseth.h"
#include "icsneo/device/tree/radmars/radmarsusb.h"
#include "icsneo/device/tree/radmoon2/radmoon2.h"
#include "icsneo/device/tree/radmoonduo/radmoonduo.h"
#include "icsneo/device/tree/radpluto/radplutousb.h"

View File

@ -12,10 +12,10 @@
#include "icsneo/device/tree/plasion/neoviplasma.h"
#include "icsneo/device/tree/radepsilon/radepsilon.h"
#include "icsneo/device/tree/radgalaxy/radgalaxy.h"
#include "icsneo/device/tree/radgigalog/radgigalogeth.h"
#include "icsneo/device/tree/radgigalog/radgigalogusb.h"
#include "icsneo/device/tree/radgigastar/radgigastareth.h"
#include "icsneo/device/tree/radgigastar/radgigastarusb.h"
#include "icsneo/device/tree/radmars/radmarseth.h"
#include "icsneo/device/tree/radmars/radmarsusb.h"
#include "icsneo/device/tree/radmoon2/radmoon2.h"
#include "icsneo/device/tree/radmoonduo/radmoonduo.h"
#include "icsneo/device/tree/radpluto/radplutousb.h"