Skip to content

Commit

Permalink
Merge branch 'sshirokov/346_filters' into sshirokov/226_clang_tidy #v…
Browse files Browse the repository at this point in the history
…erification
  • Loading branch information
serges147 committed May 3, 2024
2 parents 3a90278 + 041b19a commit fc447c1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/libcyphal/transport/can/media.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class IMedia
/// This value may change arbitrarily at runtime. The transport implementation will query it before every
/// transmission on the port. This value has no effect on the reception pipeline as it can accept arbitrary MTU.
///
CETL_NODISCARD virtual std::size_t getMtu() const noexcept = 0;
virtual std::size_t getMtu() const noexcept = 0;

/// @brief Set the filters for the CAN bus.
///
Expand Down
9 changes: 6 additions & 3 deletions include/libcyphal/transport/can/msg_rx_session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,12 @@ class MessageRxSession final : public IMessageRxSession, private IRxSessionDeleg

~MessageRxSession() final
{
::canardRxUnsubscribe(&delegate_.canard_instance(),
CanardTransferKindMessage,
static_cast<CanardPortID>(params_.subject_id));
const int8_t result = ::canardRxUnsubscribe(&delegate_.canard_instance(),
CanardTransferKindMessage,
static_cast<CanardPortID>(params_.subject_id));
(void) result;
CETL_DEBUG_ASSERT(result >= 0, "There is no way currently to get an error here.");
CETL_DEBUG_ASSERT(result > 0, "Subscription supposed to be made at constructor.");

delegate_.triggerUpdateOfFilters(false, false);
}
Expand Down
9 changes: 6 additions & 3 deletions include/libcyphal/transport/can/svc_rx_sessions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ class SvcRxSession final : public Interface_, private IRxSessionDelegate

~SvcRxSession() final
{
::canardRxUnsubscribe(&delegate_.canard_instance(),
TransferKind,
static_cast<CanardPortID>(params_.service_id));
const int8_t result = ::canardRxUnsubscribe(&delegate_.canard_instance(),
TransferKind,
static_cast<CanardPortID>(params_.service_id));
(void) result;
CETL_DEBUG_ASSERT(result >= 0, "There is no way currently to get an error here.");
CETL_DEBUG_ASSERT(result > 0, "Subscription supposed to be made at constructor.");

delegate_.triggerUpdateOfFilters(true, false);
}
Expand Down
2 changes: 1 addition & 1 deletion include/libcyphal/transport/udp/media.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class IMedia
/// This value may change arbitrarily at runtime. The transport implementation will query it before every
/// transmission on the port. This value has no effect on the reception pipeline as it can accept arbitrary MTU.
///
CETL_NODISCARD virtual std::size_t getMtu() const noexcept = 0;
virtual std::size_t getMtu() const noexcept = 0;

protected:
IMedia() = default;
Expand Down

0 comments on commit fc447c1

Please sign in to comment.