Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: nodes/frames.h
- Revision:
- 0:a3b83d366423
diff -r 000000000000 -r a3b83d366423 nodes/frames.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nodes/frames.h Wed Dec 06 21:35:45 2017 +0000 @@ -0,0 +1,27 @@ +// Lukas Bieri, Matthias, Manuel Meier & Noa Melchior +// based on Work by Matthias Grob & Manuel Stalder +// ETH 2017 + +#ifndef _FRAMES_H +#define _FRAMES_H + +//the packed attribute makes sure the types only use their respective size in memory (8 bit for uint8_t), otherwise they would always use 32 bit +//IT IS A GCC SPECIFIC DIRECTIVE +struct __attribute__((packed, aligned(1))) RangingFrame { + uint8_t source; + uint8_t destination; + uint8_t type; +}; + +struct __attribute__((packed, aligned(1))) ExtendedRangingFrame : RangingFrame{ + int signedTime; +}; + +struct __attribute__((packed, aligned(1))) StreamFrame : RangingFrame{ + uint8_t anchor_adress; + float distance; + float signalStrength; + float FPLevel; +}; + +#endif /* _FRAMES_H */