mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
Rename timestampMultiplier to timestampResolution
We've also decided to leave it out of the message structures since, for most uses going forward, it will not be needed. Anyone who wants the timestamp resolution can always make the inexpensive device call to get it.
This commit is contained in:
@@ -19,7 +19,7 @@ public:
|
||||
Decoder(device_errorhandler_t err) : err(err) {}
|
||||
bool decode(std::shared_ptr<Message>& result, const std::shared_ptr<Packet>& packet);
|
||||
|
||||
int timestampMultiplier = 25;
|
||||
uint16_t timestampResolution = 25;
|
||||
|
||||
private:
|
||||
device_errorhandler_t err;
|
||||
|
||||
@@ -12,7 +12,6 @@ public:
|
||||
Network network;
|
||||
std::vector<uint8_t> data;
|
||||
uint64_t timestamp = 0;
|
||||
int timestampMultiplier = 0;
|
||||
uint16_t description = 0;
|
||||
bool transmitted = false;
|
||||
bool error = false;
|
||||
|
||||
@@ -108,8 +108,7 @@ typedef struct {
|
||||
uint8_t header[4];
|
||||
uint16_t netid;
|
||||
uint8_t type;
|
||||
uint8_t reserved[15];
|
||||
uint16_t timestampMultiplier;
|
||||
uint8_t reserved[17];
|
||||
} neomessage_t; // 72 bytes total
|
||||
// Any time you add another neomessage_*_t type, make sure to add it to the static_asserts below!
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
static uint32_t SerialStringToNum(const std::string& serial);
|
||||
static bool SerialStringIsNumeric(const std::string& serial);
|
||||
|
||||
int getTimestampMultiplier() const;
|
||||
uint16_t getTimestampResolution() const;
|
||||
DeviceType getType() const { return DeviceType(data.type); }
|
||||
uint16_t getProductId() const { return productId; }
|
||||
std::string getSerial() const { return data.serial; }
|
||||
|
||||
@@ -99,7 +99,7 @@ protected:
|
||||
|
||||
virtual void setupDecoder(Decoder& decoder) override {
|
||||
Device::setupDecoder(decoder);
|
||||
decoder.timestampMultiplier = 10; // Timestamps are in 10ns increments instead of the usual 25ns
|
||||
decoder.timestampResolution = 10; // Timestamps are in 10ns increments instead of the usual 25ns
|
||||
}
|
||||
|
||||
virtual void setupSupportedRXNetworks(std::vector<Network>& rxNetworks) override {
|
||||
|
||||
@@ -41,7 +41,7 @@ protected:
|
||||
|
||||
virtual void setupDecoder(Decoder& decoder) override {
|
||||
Device::setupDecoder(decoder);
|
||||
decoder.timestampMultiplier = 10; // Timestamps are in 10ns increments instead of the usual 25ns
|
||||
decoder.timestampResolution = 10; // Timestamps are in 10ns increments instead of the usual 25ns
|
||||
}
|
||||
|
||||
virtual void setupSupportedRXNetworks(std::vector<Network>& rxNetworks) override {
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void setupDecoder(Decoder& decoder) override {
|
||||
decoder.timestampMultiplier = 10; // Timestamps are in 10ns increments instead of the usual 25ns
|
||||
decoder.timestampResolution = 10; // Timestamps are in 10ns increments instead of the usual 25ns
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -398,6 +398,18 @@ typedef unsigned __int64 uint64_t;
|
||||
#define NEOVI_RED_TIMESTAMP_2_10NS 429.4967296
|
||||
#define NEOVI_RED_TIMESTAMP_1_10NS 0.000000010
|
||||
|
||||
#define HARDWARE_TIMESTAMP_ID_NONE (unsigned char)0
|
||||
#define HARDWARE_TIMESTAMP_ID_VSI (unsigned char)1
|
||||
#define HARDWARE_TIMESTAMP_ID_AVT_716 (unsigned char)2
|
||||
#define HARDWARE_TIMESTAMP_ID_NI_CAN (unsigned char)3
|
||||
#define HARDWARE_TIMESTAMP_ID_NEOVI (unsigned char)4
|
||||
#define HARDWARE_TIMESTAMP_ID_AVT_717 (unsigned char)5
|
||||
#define HARDWARE_TIMESTAMP_ID_NEOv6_VCAN (unsigned char)6
|
||||
#define HARDWARE_TIMESTAMP_ID_DOUBLE_SEC (unsigned char)7
|
||||
#define HARDWARE_TIMESTAMP_ID_NEORED_10US (unsigned char)8
|
||||
#define HARDWARE_TIMESTAMP_ID_NEORED_25NS (unsigned char)9
|
||||
#define HARDWARE_TIMESTAMP_ID_NEORED_10NS (unsigned char)10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t DeviceType;
|
||||
|
||||
@@ -627,13 +627,13 @@ extern size_t DLLExport icsneo_getErrorLimit(void);
|
||||
extern bool DLLExport icsneo_getSupportedDevices(devicetype_t* devices, size_t* count);
|
||||
|
||||
/**
|
||||
* \brief Get the devices timestamp multiplier
|
||||
* \param[out] device A pointer to a buffer of devicetype_t structures which will be written to.
|
||||
* \param[inout] multiplier A pointer to an int, for legacy tick rate to ns
|
||||
* \brief Get the timestamp resolution for the given device
|
||||
* \param[out] device A pointer to the neodevice_t structure specifying the device to read out the timestamp for.
|
||||
* \param[out] resolution A pointer to a uint16_t where the resolution will be stored. This value is in nanoseconds.
|
||||
|
||||
* \returns True unless device is invalid
|
||||
* \returns True if the resolution was written
|
||||
*/
|
||||
extern bool DLLExport icsneo_getTimestampMultiplier(const neodevice_t* device, int* multiplier);
|
||||
extern bool DLLExport icsneo_getTimestampResolution(const neodevice_t* device, uint16_t* resolution);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user