From f4168c34161b414aca4fc1917ddd56faa1b88fdb Mon Sep 17 00:00:00 2001 From: KaitlynAnn99 Date: Mon, 25 Nov 2024 15:03:23 -0500 Subject: [PATCH] fixed doxy --- include/tiny_gea2_interface.h | 20 ++++------------ src/tiny_gea2_interface.c | 7 ++---- test/tests/tiny_gea2_interface_test.cpp | 31 ++----------------------- 3 files changed, 8 insertions(+), 50 deletions(-) diff --git a/include/tiny_gea2_interface.h b/include/tiny_gea2_interface.h index ae88271..0d1e543 100644 --- a/include/tiny_gea2_interface.h +++ b/include/tiny_gea2_interface.h @@ -81,16 +81,7 @@ typedef struct } tiny_gea2_interface_t; /*! - * @param instance - * @param uart - * @param time_source - * @param msec_interrupt - * @param receive_buffer - * @param receive_buffer_size - * @param send_buffer - * @param send_buffer_size - * @param address - * @param ignore_destination_address Receives all valid packets when this is enabled to allow for routing or sniffing. + * Initialize a GEA2 interface. */ void tiny_gea2_interface_init( tiny_gea2_interface_t* instance, @@ -101,18 +92,15 @@ void tiny_gea2_interface_init( uint8_t receive_buffer_size, uint8_t* send_buffer, uint8_t send_buffer_size, - uint8_t address, - bool ignore_destination_address); + uint8_t address); /*! - * Will emit received packets. Run this in the background context. - * @param instance + * Run the interface and publish received packets. */ void tiny_gea2_interface_run(tiny_gea2_interface_t* instance); /*! - * @param instance - * @param retries + * Set the retries to a custom amount */ void tiny_gea2_interface_set_retries(tiny_gea2_interface_t* instance, uint8_t retries); diff --git a/src/tiny_gea2_interface.c b/src/tiny_gea2_interface.c index 4f412a9..63b8b18 100644 --- a/src/tiny_gea2_interface.c +++ b/src/tiny_gea2_interface.c @@ -319,8 +319,7 @@ static bool received_packet_is_addressed_to_me(self_t* self) { tiny_gea3_packet_t* packet = (tiny_gea3_packet_t*)self->_private.receive.buffer; return (packet->destination == self->_private.address) || - is_broadcast_address(packet->destination) || - self->_private.ignore_destination_address; + is_broadcast_address(packet->destination); } static void send_ack(self_t* instance, uint8_t address) @@ -598,14 +597,12 @@ void tiny_gea2_interface_init( uint8_t receive_buffer_size, uint8_t* send_buffer, uint8_t send_buffer_size, - uint8_t address, - bool ignore_destination_address) + uint8_t address) { instance->interface.api = &api; instance->_private.uart = uart; instance->_private.address = address; instance->_private.retries = default_retries; - instance->_private.ignore_destination_address = ignore_destination_address; instance->_private.receive.buffer = receive_buffer; instance->_private.receive.buffer_size = receive_buffer_size; instance->_private.receive.packet_ready = false; diff --git a/test/tests/tiny_gea2_interface_test.cpp b/test/tests/tiny_gea2_interface_test.cpp index 783083f..270df66 100644 --- a/test/tests/tiny_gea2_interface_test.cpp +++ b/test/tests/tiny_gea2_interface_test.cpp @@ -60,8 +60,7 @@ TEST_GROUP(tiny_gea2_interface) receive_buffer_size, send_buffer, send_buffer_size, - address, - false); + address); tiny_event_subscription_init(&receiveSubscription, NULL, packet_received); tiny_event_subscribe(tiny_gea3_interface_on_receive(&instance.interface), &receiveSubscription); @@ -78,8 +77,7 @@ TEST_GROUP(tiny_gea2_interface) receive_buffer_size, send_buffer, send_buffer_size, - address, - true); + address); tiny_event_subscribe(tiny_gea3_interface_on_receive(&instance.interface), &receiveSubscription); } @@ -1366,28 +1364,3 @@ TEST(tiny_gea2_interface, should_enter_idle_cooldown_when_a_non_stx_byte_is_rece tiny_gea3_etx); after(1); } - -TEST(tiny_gea2_interface, should_receive_packets_addressed_to_other_nodes_when_ignore_destination_address_is_enabled) -{ - given_uart_echoing_is_enabled(); - - given_that_ignore_destination_address_is_enabled(); - - ack_should_be_sent(); - after_bytes_are_received_via_uart( - tiny_gea3_stx, - address + 1, // dst - 0x08, // len - 0x45, // src - 0xBF, // payload - 0xEF, // crc - 0xD1, - tiny_gea3_etx); - - tiny_gea3_STATIC_ALLOC_PACKET(packet, 1); - packet->destination = address + 1; - packet->source = 0x45; - packet->payload[0] = 0xBF; - packet_should_be_received(packet); - after_the_interface_is_run(); -}