aboutsummaryrefslogtreecommitdiff
path: root/src/modules/uORB/topics/telemetry_status.h
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2014-08-02 22:11:57 +0200
committerAnton Babushkin <anton.babushkin@me.com>2014-08-02 22:11:57 +0200
commitf7582b4d00f8fce4c9c93d47e2c178a36759f7ad (patch)
treebcd1f8508d84991d6ce2b2ca55c17f8afc744503 /src/modules/uORB/topics/telemetry_status.h
parent4bf83271181d2d2ddb54ad031c16135f5ccf2e7d (diff)
parentd3d5aa9bdc16b22f6e349190f18f411bd192bc2a (diff)
downloadpx4-firmware-f7582b4d00f8fce4c9c93d47e2c178a36759f7ad.tar.gz
px4-firmware-f7582b4d00f8fce4c9c93d47e2c178a36759f7ad.tar.bz2
px4-firmware-f7582b4d00f8fce4c9c93d47e2c178a36759f7ad.zip
Merge branch 'master' into smooth_pos_hold
Diffstat (limited to 'src/modules/uORB/topics/telemetry_status.h')
-rw-r--r--src/modules/uORB/topics/telemetry_status.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/modules/uORB/topics/telemetry_status.h b/src/modules/uORB/topics/telemetry_status.h
index 76693c46e..1297c1a9d 100644
--- a/src/modules/uORB/topics/telemetry_status.h
+++ b/src/modules/uORB/topics/telemetry_status.h
@@ -57,6 +57,8 @@ enum TELEMETRY_STATUS_RADIO_TYPE {
struct telemetry_status_s {
uint64_t timestamp;
+ uint64_t heartbeat_time; /**< Time of last received heartbeat from remote system */
+ uint64_t telem_time; /**< Time of last received telemetry status packet, 0 for none */
enum TELEMETRY_STATUS_RADIO_TYPE type; /**< type of the radio hardware */
uint8_t rssi; /**< local signal strength */
uint8_t remote_rssi; /**< remote signal strength */
@@ -71,6 +73,28 @@ struct telemetry_status_s {
* @}
*/
-ORB_DECLARE(telemetry_status);
+ORB_DECLARE(telemetry_status_0);
+ORB_DECLARE(telemetry_status_1);
+ORB_DECLARE(telemetry_status_2);
+ORB_DECLARE(telemetry_status_3);
+
+#define TELEMETRY_STATUS_ORB_ID_NUM 4
+
+static const struct orb_metadata *telemetry_status_orb_id[TELEMETRY_STATUS_ORB_ID_NUM] = {
+ ORB_ID(telemetry_status_0),
+ ORB_ID(telemetry_status_1),
+ ORB_ID(telemetry_status_2),
+ ORB_ID(telemetry_status_3),
+};
+
+// This is a hack to quiet an unused-variable warning for when telemetry_status.h is
+// included but telemetry_status_orb_id is not referenced. The inline works if you
+// choose to use it, but you can continue to just directly index into the array as well.
+// If you don't use the inline this ends up being a no-op with no additional code emitted.
+extern inline const struct orb_metadata *telemetry_status_orb_id_lookup(size_t index);
+extern inline const struct orb_metadata *telemetry_status_orb_id_lookup(size_t index)
+{
+ return telemetry_status_orb_id[index];
+}
#endif /* TOPIC_TELEMETRY_STATUS_H */