5 #ifndef UAVCAN_NODE_SUBSCRIBER_HPP_INCLUDED
6 #define UAVCAN_NODE_SUBSCRIBER_HPP_INCLUDED
12 #if !defined(UAVCAN_CPP_VERSION) || !defined(UAVCAN_CPP11)
13 # error UAVCAN_CPP_VERSION
16 #if UAVCAN_CPP_VERSION >= UAVCAN_CPP11
17 # include <functional>
38 template <
typename DataType_,
39 #if UAVCAN_CPP_VERSION >= UAVCAN_CPP11
40 typename Callback_ = std::function<void (
const ReceivedDataStructure<DataType_>&)>
42 typename Callback_ = void (*)(
const ReceivedDataStructure<DataType_>&)
58 if (coerceOrFallback<bool>(callback_,
true))
87 if (!coerceOrFallback<bool>(callback,
true))
90 return -ErrInvalidParam;
94 return BaseType::startAsMessageListener();
97 using BaseType::allowAnonymousTransfers;
99 using BaseType::getFailureCount;
104 #endif // UAVCAN_NODE_SUBSCRIBER_HPP_INCLUDED