aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2013-02-26 16:54:26 +0100
committerJakob Odersky <jodersky@gmail.com>2013-02-26 16:54:26 +0100
commit03edd62b745f225075fab0d96e0ec93f96c3466c (patch)
tree10e19340c33063fb8d70b5937fb3d2120e372cf5
parente8e5650006961593559b57176c4d2916b5c32d4e (diff)
downloadace-03edd62b745f225075fab0d96e0ec93f96c3466c.tar.gz
ace-03edd62b745f225075fab0d96e0ec93f96c3466c.tar.bz2
ace-03edd62b745f225075fab0d96e0ec93f96c3466c.zip
a little documentation
-rw-r--r--c/arduino/ace.h14
-rw-r--r--c/arduino/arq.h12
2 files changed, 20 insertions, 6 deletions
diff --git a/c/arduino/ace.h b/c/arduino/ace.h
index 75b178c..460b4ae 100644
--- a/c/arduino/ace.h
+++ b/c/arduino/ace.h
@@ -12,8 +12,22 @@ extern "C" {
#define SERIAL_BUFFER_SIZE 64
+/**
+* A reliable, reactive protocol implementation. Note that the default physical channel used is serial 0 and timer 1 on an Arduino.
+* This may be changed in the .c file.
+*/
+
+/** Initialize ACE for serial 0. */
void init_ace0(uint32_t baud, uint32_t extra_time);
+
+/** Send a message over serial 0. */
void ace_send0(uint8_t size, const uint8_t* const message);
+
+/** Called on message event for serial 0.
+* @param event event type, see arq.h for possible values
+* @param size size of message (if given)
+* @param message message if given or NULL
+*/
void ace_event0(message_event event, int16_t size, const uint8_t* const message);
#define init_ace init_ace0
diff --git a/c/arduino/arq.h b/c/arduino/arq.h
index 592b0d4..c1a44ef 100644
--- a/c/arduino/arq.h
+++ b/c/arduino/arq.h
@@ -12,12 +12,12 @@ extern "C" {
typedef enum {
- RECEIVED = 0,
- SEND_SUCCESS = 1,
- NO_ACK = 3,
- BAD_ACK = 4,
- SIZE_ERROR = 5,
- BUSY = 6
+ 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;
typedef void (*send_frame_function)(int16_t size, uint8_t* data);