X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fnet%2Fax25.h;h=5daabd5b4b9481cfe2ad382f8e6302dfe16c3593;hb=63a35af8aab90ed049447a2837666a52f13b9598;hp=d6213cf43859422e3260f1d087c365c277a71faf;hpb=56d6f07e5c87bf8745bb9548ae2227b39d083883;p=bertos.git diff --git a/bertos/net/ax25.h b/bertos/net/ax25.h index d6213cf4..5daabd5b 100644 --- a/bertos/net/ax25.h +++ b/bertos/net/ax25.h @@ -95,6 +95,13 @@ typedef struct AX25Call uint8_t ssid; ///< SSID (secondary station ID) for the call } AX25Call; +/** + * Create an AX25Call structure on the fly and return its pointer. + * \param str callsign, can be 6 characters or shorter. + * \param id ssid associated with the callsign. + */ +#define AX25_CALL(str, id) ({ static const AX25Call _call = { .call = (str), .ssid = (id) }; &_call; }) + /** * Maximum number of Repeaters in a AX25 message. */ @@ -146,6 +153,19 @@ typedef struct AX25Msg */ void ax25_poll(AX25Ctx *ctx); +/** + * Send an AX25 frame on the channel. + * \param ctx AX25 context to operate on. + * \param dst the destination callsign for the frame, \see AX25_CALL + * for a handy way to create a callsign on the fly. + * \param src the source callsign for the frame, \see AX25_CALL + * for a handy way to create a callsign on the fly. + * \param _buf payload buffer. + * \param len length of the payload. + */ +void ax25_send(AX25Ctx *ctx, const AX25Call *dst, const AX25Call *src, const void *_buf, size_t len); + + /** * Init the AX25 protocol decoder. *