mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
Struct packing
This commit is contained in:
@@ -9,6 +9,9 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#pragma pack(push)
|
||||||
|
#pragma pack(1)
|
||||||
|
|
||||||
namespace icsneo {
|
namespace icsneo {
|
||||||
|
|
||||||
class MessageDecoder {
|
class MessageDecoder {
|
||||||
@@ -269,4 +272,6 @@ private:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -4,26 +4,31 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#pragma pack(push)
|
||||||
|
#pragma pack(1)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint16_t netid;
|
uint64_t timestamp;
|
||||||
uint8_t type;
|
|
||||||
char header[4];
|
|
||||||
const uint8_t* data;
|
const uint8_t* data;
|
||||||
size_t length;
|
size_t length;
|
||||||
uint64_t timestamp;
|
char header[4];
|
||||||
char reserved[8];
|
uint16_t netid;
|
||||||
|
uint8_t type;
|
||||||
|
char reserved[9];
|
||||||
} neomessage_t;
|
} neomessage_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint16_t netid;
|
uint64_t timestamp;
|
||||||
uint8_t type;
|
|
||||||
uint32_t arbid;
|
|
||||||
const uint8_t* data;
|
const uint8_t* data;
|
||||||
size_t length;
|
size_t length;
|
||||||
uint64_t timestamp;
|
uint32_t arbid;
|
||||||
char reserved[8];
|
uint16_t netid;
|
||||||
|
uint8_t type;
|
||||||
|
char reserved[9];
|
||||||
} neomessage_can_t;
|
} neomessage_can_t;
|
||||||
|
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#include "communication/message/include/message.h"
|
#include "communication/message/include/message.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user