From 7923f67f3090cd5a8c7e8281f62b0beca0846bec Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Tue, 26 Feb 2013 18:18:08 +0100 Subject: remove BAD_ACK error as it limits amount of open messages --- c/arduino/arq.c | 2 -- c/arduino/arq.h | 1 - specification/specification.pdf | Bin 157405 -> 156101 bytes specification/specification.tex | 4 +--- 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/c/arduino/arq.c b/c/arduino/arq.c index 9d4a08c..88b8412 100644 --- a/c/arduino/arq.c +++ b/c/arduino/arq.c @@ -58,8 +58,6 @@ static void process_event(arq* a, arq_event event, int16_t data_size, uint8_t* d if (cmd == ACK && seq == a->last_sent_buffer[SEQ_INDEX]) { a->event_handler(SEND_SUCCESS, a->last_sent_size - MESSAGE_OFFSET, &(a->last_sent_buffer[MESSAGE_OFFSET])); - } else { - a->event_handler(BAD_ACK, a->last_sent_size - MESSAGE_OFFSET, &(a->last_sent_buffer[MESSAGE_OFFSET])); } } diff --git a/c/arduino/arq.h b/c/arduino/arq.h index c1a44ef..f6c6f74 100644 --- a/c/arduino/arq.h +++ b/c/arduino/arq.h @@ -15,7 +15,6 @@ typedef enum { RECEIVED = 0, //mesage received (received message given in event handler) SEND_SUCCESS = 1, //mesage was successfully sent (message sent given in event handler) NO_ACK = 3, //no ack was received for given message (message sent given in event handler) - BAD_ACK = 4, //bad ack or data was received for given message (message sent given in event handler) SIZE_ERROR = 5, //the message being sent is too large (message trying to be sent given in event handler) BUSY = 6 //a message has already been sent and an ack is awaited (message trying to be sent given in event handler) } message_event; diff --git a/specification/specification.pdf b/specification/specification.pdf index acd0883..fca8672 100644 Binary files a/specification/specification.pdf and b/specification/specification.pdf differ diff --git a/specification/specification.tex b/specification/specification.tex index 3e6a61b..e15f517 100644 --- a/specification/specification.tex +++ b/specification/specification.tex @@ -122,7 +122,7 @@ The values 002 and 003 are special bytes and therefore have to be escaped. Consi \begin{verbatim} 002 001 108 003 002 111 003 003 102 101 016 \end{verbatim} \section{Automatic Repeat Request (ARQ)} -To remedy the loss of invalid frames, ACE uses a kind of stop-and-wait ARQ. After sending a frame, the sender waits for an acknowledgement of the receiver before transmitting a next frame. If no acknowledgement is received in a timeout delay, the message is retransmitted. If after retransmitting the message several times no acknowledgement has been received, the message is considered to have been lost and an error is generated at the sender side. Furthermore, if the sender whilst waiting for an acknowledgement, receives an acknowledgement for a different frame other than he had sent or receives a new data frame, the sent frame is considered to be lost and an error is generated on the sender side. Only if the correct acknowledgement is received the message may be considered successfully sent and an action may be taken. +To remedy the loss of invalid frames, ACE uses a kind of stop-and-wait ARQ. After sending a frame, the sender waits for an acknowledgement of the receiver before transmitting a next frame. If no acknowledgement is received in a timeout delay, the message is retransmitted. If after retransmitting the message several times no acknowledgement has been received, the message is considered to have been lost and an error is generated at the sender side. Only if the correct acknowledgement is received the message may be considered successfully sent and an action may be taken. On the receiver side, if a frame is received, an acknowledgement to that frame is sent back and application specific action (to the message) is taken. If the same frame is received following the acknowledgement, it is considered that the sender did not receive the acknowledgement and the acknowledgement is retransmitted, this time without taking application specific action. @@ -179,8 +179,6 @@ void receive(uint size, uint8_t* data) { if (cmd == ACK && seq == last_sent_seq) { // the correct ack was returned application_specific_action_send_success(); - } else { // wrong ack or data received - error_bad_acknowledgement(); } } } -- cgit v1.2.3