add base class and template subscriber class as well to improve interface to get last msg value

This commit is contained in:
Thomas Gubler
2014-12-11 15:33:32 +01:00
parent c68c277c94
commit 998646f03b
6 changed files with 70 additions and 34 deletions
@@ -78,5 +78,5 @@ SubscriberExample::SubscriberExample() :
void SubscriberExample::rc_channels_callback(const PX4_TOPIC_T(rc_channels) &msg) {
PX4_INFO("Subscriber callback: [%llu], value of _sub_rc_chan: [%llu]",
msg.timestamp_last_valid,
((PX4_SUBSCRIBER_T(rc_channels) *)_sub_rc_chan)->get_msg().timestamp_last_valid);
_sub_rc_chan->get_msg().timestamp_last_valid);
}
+1 -1
View File
@@ -54,7 +54,7 @@ protected:
int32_t _interval;
px4_param_t _p_test_float;
float _test_float;
px4::Subscriber * _sub_rc_chan;
px4::PX4_SUBSCRIBER(rc_channels) * _sub_rc_chan;
void rc_channels_callback(const PX4_TOPIC_T(rc_channels) &msg);