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

View File

@@ -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);
}