mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-09-20 16:08:37 +02:00
Device: Add manufacturing config message
This commit is contained in:
committed by
Kyle Schwarz
parent
cf58f819cb
commit
236c6ad089
@@ -9,6 +9,7 @@
|
||||
#include <common/v1/proto_header.pb.h>
|
||||
#include <commands/generic/v1/client_id.pb.h>
|
||||
#include <commands/network/v1/mutex.pb.h>
|
||||
#include <settings/manufacturing/v1/mfg_config.pb.h>
|
||||
#ifdef _WIN32
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
@@ -36,6 +37,11 @@ struct IDLookup {
|
||||
constexpr static common::v1::ProtoId value = common::v1::ProtoId::PROTO_ID_UNSPECIFIED;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct IDLookup<settings::manufacturing::v1::MfgConfig> {
|
||||
constexpr static common::v1::ProtoId value = common::v1::ProtoId::PROTO_ID_MFG_CONFIG;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct IDLookup<commands::network::v1::NetworkMutex> {
|
||||
constexpr static common::v1::ProtoId value = common::v1::ProtoId::PROTO_ID_NETWORK_MUTEX;
|
||||
|
||||
@@ -51,6 +51,7 @@ public:
|
||||
SPIPortKeyOperation = 0x8019,
|
||||
GenericAPIData = 0x8020,
|
||||
GenericAPIStatus = 0x8021,
|
||||
MfgConfig = 0x8022,
|
||||
};
|
||||
|
||||
Message(Type t) : type(t) {}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
#ifndef __MFGCONFIGMESSAGE_H_
|
||||
#define __MFGCONFIGMESSAGE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/communication/message/message.h"
|
||||
#include "icsneo/communication/message/allmacaddressesmessage.h"
|
||||
#include "icsneo/device/chipid.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class MfgConfigMessage : public Message {
|
||||
public:
|
||||
struct MfgDate {
|
||||
uint32_t day = 0;
|
||||
uint32_t month = 0;
|
||||
uint32_t year = 0;
|
||||
};
|
||||
|
||||
struct VersionNumber {
|
||||
uint32_t major = 0;
|
||||
uint32_t minor = 0;
|
||||
std::optional<uint32_t> release;
|
||||
std::optional<uint32_t> build;
|
||||
};
|
||||
|
||||
MfgConfigMessage() : Message(Message::Type::MfgConfig) {}
|
||||
|
||||
static std::shared_ptr<MfgConfigMessage> DecodeToMessage(const std::vector<uint8_t>& bytestream);
|
||||
static std::vector<uint8_t> EncodeArgumentsForGet();
|
||||
|
||||
std::optional<uint64_t> serialNumber;
|
||||
std::optional<MfgDate> manufactureDate;
|
||||
std::optional<VersionNumber> hardwareRev;
|
||||
std::optional<uint8_t> productId;
|
||||
std::optional<VersionNumber> bootloaderRev;
|
||||
std::optional<std::string> usbDescriptor;
|
||||
std::vector<MACAddress> macAddresses;
|
||||
std::optional<std::string> pcbSerial;
|
||||
std::optional<ChipID> chipId;
|
||||
std::optional<uint64_t> imei;
|
||||
std::optional<uint8_t> parentProductId;
|
||||
std::optional<VersionNumber> softwareVersionLock;
|
||||
};
|
||||
|
||||
} // namespace icsneo
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __MFGCONFIGMESSAGE_H_
|
||||
@@ -63,6 +63,7 @@
|
||||
#include "icsneo/communication/message/gptpstatusmessage.h"
|
||||
#include "icsneo/communication/message/networkmutexmessage.h"
|
||||
#include "icsneo/communication/message/allmacaddressesmessage.h"
|
||||
#include "icsneo/communication/message/mfgconfigmessage.h"
|
||||
|
||||
#define ICSNEO_FINDABLE_DEVICE_BASE(className, type) \
|
||||
static constexpr DeviceType::Enum DEVICE_TYPE = type; \
|
||||
@@ -345,6 +346,7 @@ public:
|
||||
virtual Network getNetworkByNumber(Network::Type, size_t) const;
|
||||
|
||||
std::shared_ptr<HardwareInfo> getHardwareInfo(std::chrono::milliseconds timeout = std::chrono::milliseconds(100));
|
||||
std::shared_ptr<MfgConfigMessage> getMfgConfig();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user