summaryrefslogtreecommitdiffstats
path: root/include/protocol.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/protocol.h')
-rw-r--r--include/protocol.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/include/protocol.h b/include/protocol.h
index 5872fa3..9d5b518 100644
--- a/include/protocol.h
+++ b/include/protocol.h
@@ -23,8 +23,8 @@
#include <errno.h>
-#define SUCCESS (0)
-#define TLV_OVERFLOW (1 << 0)
+#define E_TLV_OVERFLOW (1 << 0)
+#define E_UNKNOWN_TYPE (1 << 1)
enum packet_type {
REGURAL,
@@ -33,27 +33,27 @@ enum packet_type {
};
enum tlv_type {
- /* NULL-terminated string. */
+ /** NULL-terminated string. */
TEXT,
-
- /* Fixed point. 1 decimal digit of precision. */
+
+ /** Fixed point. 1 decimal digit of precision. */
FPI1,
-
- /* Literally time_t*/
+
+ /** Literally time_t*/
TIMESTAMP,
-
- /* Represents a request for lost message. Data is unsigned integer
- * that uniquely identifies the message.
+
+ /** Represents a request for lost message. Data is unsigned integer
+ * that uniquely identifies the message.
*/
REQUEST,
-
- /* Response to request. Begins with unsigned integer that represents
- * which message is begin repeated and the actual null-terminated
+
+ /** Response to request. Begins with unsigned integer that represents
+ * which message is being repeated and the actual null-terminated
* message after that.
*/
REPLY,
-
- /* UUID that represents a particular device.
+
+ /** UUID that represents a particular device.
*/
UUID
};
@@ -88,7 +88,7 @@ void clear_data(void);
/* Appends data to the next packet to be sent. Type of data is determined by
* enum tlv_type.
* */
-void push_data(char *data, enum tlv_type);
+int push_data(const char *data, enum tlv_type);
/* Sends packet towards the other end.
* */