From cafdb86d36274921d12ee8c3559b40474834e41c Mon Sep 17 00:00:00 2001 From: asterix Date: Mon, 9 Feb 2009 13:51:21 +0000 Subject: [PATCH] Fix comments and add wizard info. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2331 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/cfg_pocketbus.h | 2 +- bertos/net/pocketbus.c | 4 ++-- bertos/net/pocketbus.h | 12 +++++++++--- bertos/net/pocketcmd.h | 7 ++++++- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/bertos/cfg/cfg_pocketbus.h b/bertos/cfg/cfg_pocketbus.h index f3f5fbca..47dfce88 100644 --- a/bertos/cfg/cfg_pocketbus.h +++ b/bertos/cfg/cfg_pocketbus.h @@ -40,7 +40,7 @@ #ifndef CFG_POCKETBUS_H #define CFG_POCKETBUS_H -/// Buffer len for pockebus protocol. +/// Buffer len for pockebus protocol. $WIZARD = { "type" : "int", "min" : "0" } #define CONFIG_POCKETBUS_BUFLEN 128 #endif /* CFG_POCKETBUS_H */ diff --git a/bertos/net/pocketbus.c b/bertos/net/pocketbus.c index fb50a278..a9cb4727 100644 --- a/bertos/net/pocketbus.c +++ b/bertos/net/pocketbus.c @@ -98,7 +98,7 @@ void pocketbus_putchar(struct PocketBusCtx *ctx, uint8_t c) /* Escape characters with special meaning */ if (c == POCKETBUS_ESC || c == POCKETBUS_STX || c == POCKETBUS_ETX) kfile_putc(POCKETBUS_ESC, ctx->fd); - + kfile_putc(c, ctx->fd); } @@ -115,7 +115,7 @@ void pocketbus_begin(struct PocketBusCtx *ctx, pocketbus_addr_t addr) /* Send STX */ kfile_putc(POCKETBUS_STX, ctx->fd); - + /* Send header */ pocketbus_write(ctx, &hdr, sizeof(hdr)); } diff --git a/bertos/net/pocketbus.h b/bertos/net/pocketbus.h index ed970cd9..7e1317d7 100644 --- a/bertos/net/pocketbus.h +++ b/bertos/net/pocketbus.h @@ -33,7 +33,13 @@ * * \author Francesco Sacchi * - * \brief pocketBus protocol interface. + * \brief Basical functions to use pocketBus protocol. + * + * $WIZARD_MODULE = { + * "name" : "pocketbus", + * "depends" : ["rotating_hash", "kfile"], + * "configuration" : "bertos/cfg/cfg_pocketbus.h" + * } */ #ifndef NET_POCKETBUS_H @@ -76,7 +82,7 @@ typedef uint16_t pocketbus_addr_t; */ typedef struct PocketBusHdr { - #define POCKETBUS_VER 1 + #define POCKETBUS_VER 1 uint8_t ver; ///< packet version pocketbus_addr_t addr; ///< slave address } PocketBusHdr; @@ -102,7 +108,7 @@ typedef struct PocketMsg { struct PocketBusCtx *ctx; ///< pocketBus message context pocketbus_addr_t addr; ///< address for received packet - pocketbus_len_t len; ///< payload length + pocketbus_len_t len; ///< payload length const uint8_t *payload; ///< payload data } PocketMsg; diff --git a/bertos/net/pocketcmd.h b/bertos/net/pocketcmd.h index 9f92b00b..7cbc98bf 100644 --- a/bertos/net/pocketcmd.h +++ b/bertos/net/pocketcmd.h @@ -29,12 +29,17 @@ * Copyright 2007 Develer S.r.l. (http://www.develer.com/) * --> * - * \brief pocketBus protocol command layer interface. + * \brief PocketBus command abstraction layer. * * \version $Id: pocketcmd.h 20030 2007-12-04 16:16:09Z batt $ * * \author Francesco Sacchi * + * $WIZARD_MODULE = { + * "name" : "pocketcmd", + * "depends" : ["timer", "pocketbus"], + * "configuration" : "" + * } */ #ifndef NET_POCKETCMD_H -- 2.25.1