Fixed CAN frame bug

This commit is contained in:
2024-03-06 11:47:50 -05:00
parent 8d472f4f64
commit b7d8fef0ab
8 changed files with 180 additions and 178 deletions

View File

@ -38,7 +38,7 @@ class CanSignal : public BaseSignal, public VoltType {
class CanSignal {
#endif
// public data
public:
public:
std::string Name; // Signal Name
std::string Units; // Signal Units
u_int32_t Address; // 29 bits (standard or extended)
@ -75,12 +75,12 @@ public:
// private data
private:
private:
// static data
// public methods
public:
public:
// constructors
CanSignal();
@ -110,7 +110,7 @@ public:
// static methods
// private methods
private:
private:
};
#endif

View File

@ -33,7 +33,7 @@ typedef struct can_frame CanFrame;
typedef struct _BcmFrame {
struct bcm_msg_head head;
struct can_frame frame;
// struct can_frame frame;
} BcmFrame;
/* c class definitions ******************************************************/

View File

@ -28,6 +28,8 @@ set(LIBSRC
# includes
include_directories(../include)
add_compile_options(-Warray-bounds)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../lib)

View File

@ -255,7 +255,7 @@ int CanSocket::CanAddRx( u_int32_t addr )
// mask
msg.head.nframes = 1;
U64_DATA(&msg.frame) = (__u64) 0xFFFFFFFFFFFFFFFFULL; // all 64 bits
U64_DATA(&msg.head.frames[0]) = (__u64) 0xFFFFFFFFFFFFFFFFULL; // all 64 bits
// send it down
if (write(m_sock, &msg, sizeof(msg)) < 0)

View File

@ -33,7 +33,7 @@ typedef struct can_frame CanFrame;
typedef struct _BcmFrame {
struct bcm_msg_head head;
struct can_frame frame;
// struct can_frame frame;
} BcmFrame;
/* c class definitions ******************************************************/