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

View File

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

View File

@ -28,6 +28,8 @@ set(LIBSRC
# includes # includes
include_directories(../include) include_directories(../include)
add_compile_options(-Warray-bounds)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../lib)
set(CMAKE_LIBRARY_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 // mask
msg.head.nframes = 1; 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 // send it down
if (write(m_sock, &msg, sizeof(msg)) < 0) if (write(m_sock, &msg, sizeof(msg)) < 0)

View File

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