mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Fix MSG_TS macro
This commit is contained in:
parent
3db0a1894f
commit
e8ed440ccf
2 changed files with 4 additions and 5 deletions
|
@ -43,10 +43,9 @@
|
|||
#define MSG_DATA_OFFSET(msg) ((char *) (msg) + offsetof(struct msg, data))
|
||||
|
||||
/** The timestamp of a message in struct timespec format */
|
||||
#define MSG_TS(msg) (struct timespec) { \
|
||||
.tv_sec = (msg)->ts.sec, \
|
||||
.tv_nsec = (msg)->ts.nsec \
|
||||
}
|
||||
#define MSG_TS(msg, i) \
|
||||
i.tv_sec = (msg)->ts.sec; \
|
||||
i.tv_nsec = (msg)->ts.nsec;
|
||||
|
||||
/** This message format is used by all clients
|
||||
*
|
||||
|
|
|
@ -84,7 +84,7 @@ int msg_to_sample(struct msg *msg, struct sample *smp, struct vlist *signals)
|
|||
smp->flags = SAMPLE_HAS_TS_ORIGIN | SAMPLE_HAS_SEQUENCE | SAMPLE_HAS_DATA;
|
||||
smp->length = MIN(msg->length, smp->capacity);
|
||||
smp->sequence = msg->sequence;
|
||||
smp->ts.origin = MSG_TS(msg);
|
||||
MSG_TS(msg, smp->ts.origin);
|
||||
|
||||
for (unsigned i = 0; i < MIN(smp->length, vlist_length(signals)); i++) {
|
||||
struct signal *sig = (struct signal *) vlist_at(signals, i);
|
||||
|
|
Loading…
Add table
Reference in a new issue