Alejandro Ungria Hirte / GA-Test_copy

Dependencies:   mbed-dev

Revision:
0:a3b83d366423
--- /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 */