X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fnet%2Fpocketbus.h;h=7e1317d7995bc2d285c03a8451c04ba40bc8334d;hb=00bc8478ab5087769fc67e52327934370ee5e3a6;hp=d7f6a5fbf4787a97f55f74e7de7a7881fd44d45b;hpb=8c391d2f8a7cf500ecd0331a9b183239af914e8e;p=bertos.git diff --git a/bertos/net/pocketbus.h b/bertos/net/pocketbus.h index d7f6a5fb..7e1317d7 100644 --- a/bertos/net/pocketbus.h +++ b/bertos/net/pocketbus.h @@ -1,6 +1,31 @@ /** * \file * * @@ -8,17 +33,26 @@ * * \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 #define NET_POCKETBUS_H +#include "cfg/cfg_pocketbus.h" /* for CONFIG_POCKETBUS_BUFLEN */ +#include + #include + #include + #include -#include -#include "appconfig.h" //for CONFIG_POCKETBUS_BUFLEN /** * pocketBus special characters definitions. @@ -48,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; @@ -74,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;