Clean up. Use log module. Add cfg file and move some setting to cfg.
[bertos.git] / bertos / net / keytag.h
index 0985a2071d950fd2fb3491e86902aeff0bf6c5aa..375b490e9e32325243451495a897422828898a7e 100644 (file)
  * \author Andrea Grandi <andrea@develer.com>
  *
  * \brief Tag protocol. (interface).
+ *
+ * $WIZ$ module_name = "keytag"
+ * $WIZ$ module_configuration = "bertos/cfg/cfg_keytag.h"
+ * $WIZ$ module_depends = "kfile"
+ * $WIZ$ module_hw = ""
  */
 
 #ifndef NET_KEYTAG_H
 #define NET_KEYTAG_H
 
-#include <kern/kfile.h>
-#include <drv/ser.h>
-
-/**
- * Starting communication char (STX).
- */
-#define TAG_STX 0x02
-
-/**
- * Ending communication char (ETX).
- */
-#define TAG_ETX 0x03
-
-/**
- * Max buffer lenght
- */
-#define TAG_MAX_LEN 14
+#include <cfg/cfg_keytag.h>
 
+#include <kern/kfile.h>
 
-/**
- * Max number of chars to print in the communication serial
- */
-#define TAG_MAX_PRINT_CHARS 12
 
 /**
  * Structure of a Tag packet
  */
 typedef struct TagPacket
 {
-       KFile *tag;                 ///< Tag communication channel
-       KFile *host;                ///< Host communication channel
-       bool sync;                  ///< Status flag: true if we find an STX
-       uint16_t len;               ///< Packet lenght
-       uint8_t buf[TAG_MAX_LEN];   ///< Reception buffer
+       KFile *tag;                        ///< Tag communication channel
+       KFile *host;                       ///< Host communication channel
+       bool sync;                         ///< Status flag: true if we find an STX
+       uint16_t len;                      ///< Packet lenght
+       uint8_t buf[CONFIG_TAG_MAX_LEN];   ///< Reception buffer
 } TagPacket;
 
 void keytag_init(struct TagPacket *pkt, struct KFile *comm, struct KFile *tag);