mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Support Ethernet and Broad-R Reach TX and RX
This commit is contained in:
@@ -10,8 +10,6 @@
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class Decoder {
|
||||
@@ -20,44 +18,13 @@ public:
|
||||
|
||||
Decoder(device_errorhandler_t err) : err(err) {}
|
||||
bool decode(std::shared_ptr<Message>& result, const std::shared_ptr<Packet>& packet);
|
||||
|
||||
|
||||
int timestampMultiplier = 25;
|
||||
|
||||
private:
|
||||
device_errorhandler_t err;
|
||||
typedef uint16_t icscm_bitfield;
|
||||
struct HardwareCANPacket {
|
||||
struct {
|
||||
icscm_bitfield IDE : 1;
|
||||
icscm_bitfield SRR : 1;
|
||||
icscm_bitfield SID : 11;
|
||||
icscm_bitfield EDL : 1;
|
||||
icscm_bitfield BRS : 1;
|
||||
icscm_bitfield ESI : 1;
|
||||
} header;
|
||||
struct {
|
||||
icscm_bitfield EID : 12;
|
||||
icscm_bitfield TXMSG : 1;
|
||||
icscm_bitfield TXAborted : 1;
|
||||
icscm_bitfield TXLostArb : 1;
|
||||
icscm_bitfield TXError : 1;
|
||||
} eid;
|
||||
struct {
|
||||
icscm_bitfield DLC : 4;
|
||||
icscm_bitfield RB0 : 1;
|
||||
icscm_bitfield IVRIF : 1;
|
||||
icscm_bitfield HVEnable : 1;// must be cleared before passing into CAN driver
|
||||
icscm_bitfield ExtendedNetworkIndexBit : 1;//DO NOT CLOBBER THIS
|
||||
icscm_bitfield RB1 : 1;
|
||||
icscm_bitfield RTR : 1;
|
||||
icscm_bitfield EID2 : 6;
|
||||
} dlc;
|
||||
unsigned char data[8];
|
||||
uint16_t stats;
|
||||
struct {
|
||||
uint64_t TS : 60;
|
||||
uint64_t : 3; // Reserved for future status bits
|
||||
uint64_t IsExtended : 1;
|
||||
} timestamp;
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
@@ -99,10 +66,9 @@ private:
|
||||
uint16_t busVoltage;
|
||||
uint16_t deviceTemperature;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user