Skip to content

Commit 5360232

Browse files
committed
rx: remove unused redundant_iface_index
1 parent 85d0764 commit 5360232

5 files changed

Lines changed: 5 additions & 14 deletions

File tree

libserard/serard.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,6 @@ SERARD_PRIVATE int8_t rxAcceptByte(struct SerardRx* const ins,
689689
struct SerardReassembler* const reassembler,
690690
const SerardMicrosecond timestamp_usec,
691691
const uint8_t payload_byte,
692-
const uint8_t redundant_iface_index,
693692
struct SerardRxTransfer* const out_transfer)
694693
{
695694
int8_t ret = 0;
@@ -709,7 +708,6 @@ SERARD_PRIVATE int8_t rxAcceptByte(struct SerardRx* const ins,
709708
{
710709
// if the state machine is accepting the payload, try to accept
711710
// the received transfer payload and return to the user
712-
// FIXME: what is the redundant interface index for?
713711
ret = rxAcceptTransfer(ins, reassembler, out_transfer);
714712
if (ret == 1)
715713
{
@@ -934,7 +932,6 @@ int8_t serardRxAccept(struct SerardRx* const ins,
934932
SerardMicrosecond const timestamp_usec,
935933
size_t* const inout_payload_size,
936934
const uint8_t* const payload,
937-
const uint8_t redundant_transport_index,
938935
struct SerardRxTransfer* const out_transfer,
939936
struct SerardRxSubscription** const out_subscription)
940937
{
@@ -945,8 +942,7 @@ int8_t serardRxAccept(struct SerardRx* const ins,
945942
for (size_t i = 0; i < in_payload_size; i++)
946943
{
947944
const uint8_t payload_byte = payload[i];
948-
const int8_t out =
949-
rxAcceptByte(ins, reassembler, timestamp_usec, payload_byte, redundant_transport_index, out_transfer);
945+
const int8_t out = rxAcceptByte(ins, reassembler, timestamp_usec, payload_byte, out_transfer);
950946
if (out != 0)
951947
{
952948
if (out < 0)

libserard/serard.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ int8_t serardRxAccept(struct SerardRx* const ins,
351351
const SerardMicrosecond timestamp_usec,
352352
size_t* const inout_payload_size,
353353
const uint8_t* const payload,
354-
const uint8_t redundant_transport_index,
355354
struct SerardRxTransfer* const out_transfer,
356355
struct SerardRxSubscription** const out_subscription);
357356

tests/exposed.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ struct RxSession
2727
SerardMicrosecond transfer_timestamp_usec = std::numeric_limits<std::uint64_t>::max();
2828
SerardTransferID transfer_id = std::numeric_limits<std::uint8_t>::max();
2929
SerardNodeID source_node_id = 0U;
30-
std::uint8_t redundant_iface_index = std::numeric_limits<std::uint8_t>::max();
3130
};
3231

3332
struct CobsEncoder
@@ -91,17 +90,14 @@ auto txMakeHeader(const SerardNodeID node_
9190
auto rxSessionUpdate(struct SerardRx* const ins,
9291
struct SerardInternalRxSession* const rxs,
9392
const struct SerardRxTransfer* const transfer,
94-
const std::uint8_t redundant_iface_index,
9593
const SerardMicrosecond transfer_id_timeout_usec) -> void;
9694
[[nodiscard]] auto rxAcceptTransfer(struct SerardRx* const ins,
9795
struct SerardReassembler* const reassembler,
98-
struct SerardRxTransfer* const transfer,
99-
const std::uint8_t redundant_iface_index) -> std::int8_t;
96+
struct SerardRxTransfer* const transfer) -> std::int8_t;
10097
[[nodiscard]] auto rxAcceptByte(struct SerardRx* const ins,
10198
struct SerardReassembler* const reassembler,
10299
const SerardMicrosecond timestamp_usec,
103100
const std::uint8_t payload_byte,
104-
const std::uint8_t redundant_iface_index,
105101
struct SerardRxTransfer* const out_transfer) -> std::int8_t;
106102
}
107103
} // namespace exposed

tests/test_private.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ TEST_CASE("rxValidateHeader")
562562
const std::array<std::uint8_t, 24> buffer = {0x01, 0x07, 0xD2, 0x04, 0xE1, 0x10, 0xEA, 0xC0,
563563
0xBA, 0xB0, 0xFE, 0xCA, 0x00, 0x00, 0x00, 0x00,
564564
0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xDB, 0x89};
565-
std::copy(buffer.begin(), buffer.end(), reassembler.header);
565+
std::copy(buffer.begin(), buffer.end(), &reassembler.header[0]);
566566
reassembler.counter = buffer.size() - 1;
567567

568568
struct SerardRxTransfer transfer = {};
@@ -585,7 +585,7 @@ TEST_CASE("rxValidateHeader")
585585
const std::array<std::uint8_t, 24> buffer = {0x01, 0x07, 0xD2, 0x04, 0xE1, 0x10, 0xEA, 0xC0,
586586
0xBA, 0xB0, 0xFE, 0xCA, 0x00, 0x00, 0x00, 0x00,
587587
0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xDB, 0x89};
588-
std::copy(buffer.begin(), buffer.end(), reassembler.header);
588+
std::copy(buffer.begin(), buffer.end(), &reassembler.header[0]);
589589
reassembler.counter = buffer.size() - 1;
590590

591591
struct SerardRxTransfer transfer = {};

tests/test_public.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ TEST_CASE("serardRxAccept")
117117
size_t payload_size = buffer.size();
118118
SerardRxTransfer out = {};
119119
SerardRxSubscription* out_sub = nullptr;
120-
const int8_t ret = serardRxAccept(&ins, &reassembler, 0, &payload_size, buffer.data(), 0, &out, &out_sub);
120+
const int8_t ret = serardRxAccept(&ins, &reassembler, 0, &payload_size, buffer.data(), &out, &out_sub);
121121
REQUIRE(ret == 1);
122122

123123
// struct SerardTransferMetadata metadata = {

0 commit comments

Comments
 (0)