Skip to content

Commit 4694d0d

Browse files
committed
build fix; more docs
1 parent feac369 commit 4694d0d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

libcyphal_demo/src/file_downloader.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class FileDownloader final
5353

5454
state_.file_size = 0;
5555
state_.file_progress = 0;
56-
state_.file_path = file_path;
56+
state_.file_path = {file_path.data(), file_path.size()};
5757
state_.start_time = time_provider_.now();
5858
state_.file_error.value = uavcan::file::Error_1_0::OK;
5959

libcyphal_demo/src/platform/common_helpers.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ struct CommonHelpers
9494
}),
9595
report_var);
9696

97+
// "swallows" all transient failures, thus giving a chance
98+
// to other redundant media interfaces to continue.
9799
return cetl::nullopt;
98100
}
99101

@@ -154,6 +156,8 @@ struct CommonHelpers
154156
}),
155157
report_var);
156158

159+
// "swallows" all transient failures, thus giving a chance
160+
// to other redundant media interfaces to continue.
157161
return cetl::nullopt;
158162
}
159163

libcyphal_demo/src/transport_bag_can.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ struct TransportBagCan final
6565
const std::size_t block_size = mtu;
6666
const std::size_t pool_size = media_collection_.count() * TxQueueCapacity * block_size;
6767
media_block_mr_.setup(pool_size, block_size, block_alignment);
68+
69+
// To support redundancy (multiple homogeneous interfaces), it's important to have a non-default
70+
// handler which "swallows" expected transient failures (by returning `nullopt` result).
71+
// Otherwise, the default Cyphal behavior will fail/interrupt current and future transfers
72+
// if some of its media encounter transient failures - thus breaking the whole redundancy goal,
73+
// namely, maintain communication if at least one of the interfaces is still up and running.
74+
//
6875
transport_->setTransientErrorHandler([](auto&) { return cetl::nullopt; });
6976
// transport_->setTransientErrorHandler(platform::CommonHelpers::Can::transientErrorReporter);
7077

0 commit comments

Comments
 (0)