X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fnet%2Fax25.h;h=dd439445465495b37357bff42766af1281bbe39b;hb=eefaad50a316d12474a2792088f9304903c059fa;hp=0e609136f18e5d56f20b066f39b6ea23eacaa731;hpb=e47f203a5648786cd782d921880a77a395570059;p=bertos.git diff --git a/bertos/net/ax25.h b/bertos/net/ax25.h index 0e609136..dd439445 100644 --- a/bertos/net/ax25.h +++ b/bertos/net/ax25.h @@ -34,7 +34,6 @@ * For now, only UI frames without any Layer 3 protocol are handled. * This however is enough to send/receive APRS packets. * - * \version $Id$ * \author Francesco Sacchi * * $WIZ$ module_name = "ax25" @@ -49,7 +48,7 @@ #include "cfg/cfg_ax25.h" #include -#include +#include /** * Maximum size of a AX25 frame. @@ -107,6 +106,11 @@ typedef struct AX25Call */ #define AX25_MAX_RPT 8 +/* + * Has to be lesser than 8 in order to fit in one byte + * change AX25Msg.rpt_flags if you need more repeaters. + */ +STATIC_ASSERT(AX25_MAX_RPT <= 8); /** * AX25 Message. @@ -119,6 +123,8 @@ typedef struct AX25Msg #if CONFIG_AX25_RPT_LST AX25Call rpt_lst[AX25_MAX_RPT]; ///< List of repeaters uint8_t rpt_cnt; ///< Number of repeaters in this message + uint8_t rpt_flags; ///< Has-been-repeated flags for each repeater (bit-mapped) + #define AX25_REPEATED(msg, idx) ((msg)->rpt_flags & BV(idx)) #endif uint16_t ctrl; ///< AX25 control field uint8_t pid; ///< AX25 PID field @@ -126,6 +132,7 @@ typedef struct AX25Msg size_t len; ///< Payload length } AX25Msg; + #define AX25_CTRL_UI 0x03 #define AX25_PID_NOLAYER3 0xF0