![]() |
SysIo
1.9.0
Embedded Library and tools
|
Ce module fournit les fonctions permettant de transmettre des informations sur des liaisons Ax25.
![]() |
Modules | |
Contrôleur de noeud terminal Ax25 | |
Interface C++ | |
Classes | |
struct | xAx25 |
struct | xAx25Frame |
struct | xAx25Node |
Macros | |
#define | AX25_CALL_LEN 6 |
#define | AX25_CTRL_UI 0x03 |
#define | AX25_FRAME_BUF_LEN ((AX25_CALL_LEN+1)*(2+AX25_MAX_RPT)+AX25_INFO_LEN+4) |
#define | AX25_INFO_LEN 256 |
#define | AX25_MAX_RPT 8 |
#define | AX25_PID_NOLAYER3 0xF0 |
HDLC flags. | |
These should be moved in a separated HDLC related file one day... | |
enum | eAx25Error { AX25_SUCCESS = 0, AX25_FILE_ACCESS_ERROR = -1, AX25_ILLEGAL_CALLSIGN = -2, AX25_INVALID_FRAME = -3, AX25_CRC_ERROR = -4, AX25_NOT_ENOUGH_MEMORY = -5, AX25_NOT_ENOUGH_REPEATER = -6, AX25_OBJECT_NOT_FOUND = -7, AX25_FILE_NOT_FOUND = -8, AX25_ILLEGAL_REPEATER = -9, AX25_NO_FRAME_RECEIVED = -10 } |
typedef struct xAx25Node | xAx25Node |
typedef struct xAx25Frame | xAx25Frame |
typedef struct xAx25 | xAx25 |
xAx25Node * | xAx25NodeNew (void) |
void | vAx25NodeDelete (xAx25Node *n) |
int | iAx25NodeClear (xAx25Node *n) |
int | iAx25NodeSetCallsign (xAx25Node *n, const char *callsign) |
char * | xAx25NodeToStr (const xAx25Node *p) |
int | iAx25NodePrint (const xAx25Node *n) |
int | iAx25NodeFilePrint (const xAx25Node *n, FILE *f) |
xAx25Frame * | xAx25FrameNew (void) |
void | vAx25FrameDelete (xAx25Frame *frame) |
int | iAx25FrameClear (xAx25Frame *frame) |
int | iAx25FrameSetSrc (xAx25Frame *frame, const char *callsign, uint8_t ssid) |
int | iAx25FrameSetDst (xAx25Frame *frame, const char *callsign, uint8_t ssid) |
int | iAx25FrameAddRepeater (xAx25Frame *frame, const char *callsign, uint8_t ssid) |
int | iAx25FrameSetRepeaterFlag (xAx25Frame *frame, uint8_t index, bool flag) |
int | iAx25FrameSetInfo (xAx25Frame *frame, const void *info, size_t info_len) |
char * | xAx25FrameToStr (const xAx25Frame *frame) |
int | iAx25FrameFilePrint (const xAx25Frame *frame, FILE *f) |
int | iAx25FramePrint (const xAx25Frame *frame) |
xAx25 * | xAx25New (void) |
void | vAx25Delete (xAx25 *p) |
int | iAx25Clear (xAx25 *p) |
int | iAx25SetFdin (xAx25 *p, int fdin) |
int | iAx25SetFdout (xAx25 *p, int fdout) |
bool | bAx25Poll (xAx25 *ax25) |
int | iAx25Send (xAx25 *ax25, const xAx25Frame *frame) |
int | iAx25Read (xAx25 *ax25, xAx25Frame *frame) |
int | iAx25Error (xAx25 *ax25) |
#define | HDLC_FLAG 0x7E |
#define | HDLC_RESET 0x7F |
#define | AX25_ESC 0x1B |
#define AX25_CALL_LEN 6 |
#define AX25_CTRL_UI 0x03 |
#define AX25_FRAME_BUF_LEN ((AX25_CALL_LEN+1)*(2+AX25_MAX_RPT)+AX25_INFO_LEN+4) |
#define AX25_INFO_LEN 256 |
#define AX25_MAX_RPT 8 |
#define AX25_PID_NOLAYER3 0xF0 |
typedef struct xAx25Frame xAx25Frame |
#include <ax25.h>
AX25 Frame Class Used to handle AX25 sent/received messages.
enum eAx25Error |
bool bAx25Poll | ( | xAx25 * | ax25 | ) |
#include <ax25.h>
Check if there are any AX25 messages to be processed. This function read available characters from the medium and search for any AX25 messages. If a message is found, this function return true and the message can be read with iAx25Read(). This function may be blocking if there are no available chars and the FILE used in ax25 to access the medium is configured in blocking mode.
ax25 | AX25 object to operate on. |
int iAx25Clear | ( | xAx25 * | p | ) |
#include <ax25.h>
Clear all fields of the object
int iAx25Error | ( | xAx25 * | ax25 | ) |
#include <ax25.h>
Retruns the last error code.
int iAx25FrameAddRepeater | ( | xAx25Frame * | frame, |
const char * | callsign, | ||
uint8_t | ssid | ||
) |
#include <ax25.h>
Adds a repeater to the frame
frame | AX25 frame object to operate on. |
callsign | Call string, max 6 character |
SSID | (secondary station ID) for the call |
int iAx25FrameClear | ( | xAx25Frame * | frame | ) |
#include <ax25.h>
Clear the frame
src and dst are cleared with iAx25NodeClear() All the repeaters are removed. The ctrl is set to AX25_CTRL_UI, the pid to AX25_PID_NOLAYER3.
int iAx25FrameFilePrint | ( | const xAx25Frame * | frame, |
FILE * | f | ||
) |
#include <ax25.h>
Print a AX25 message in TNC-2 packet monitor format in a file
f | a file channel where the message will be printed. |
frame | the message to be printed. |
int iAx25FramePrint | ( | const xAx25Frame * | frame | ) |
#include <ax25.h>
Print a AX25 message in TNC-2 packet monitor format.
frame | the message to be printed. |
int iAx25FrameSetDst | ( | xAx25Frame * | frame, |
const char * | callsign, | ||
uint8_t | ssid | ||
) |
#include <ax25.h>
Sets the destination address of frame
frame | AX25 frame object to operate on. |
callsign | Call string, max 6 character |
SSID | (secondary station ID) for the call |
int iAx25FrameSetInfo | ( | xAx25Frame * | frame, |
const void * | info, | ||
size_t | info_len | ||
) |
#include <ax25.h>
Sets the info field of frame
frame | AX25 frame object to operate on. |
callsign | Call string, max 6 character |
SSID | (secondary station ID) for the call |
int iAx25FrameSetRepeaterFlag | ( | xAx25Frame * | frame, |
uint8_t | index, | ||
bool | flag | ||
) |
#include <ax25.h>
Sets the repeater flag
frame | AX25 frame object to operate on. |
index | index of repeater |
flag | new flag value |
int iAx25FrameSetSrc | ( | xAx25Frame * | frame, |
const char * | callsign, | ||
uint8_t | ssid | ||
) |
#include <ax25.h>
Sets the source address of frame
frame | AX25 frame object to operate on. |
callsign | Call string, max 6 character |
SSID | (secondary station ID) for the call |
int iAx25NodeClear | ( | xAx25Node * | n | ) |
#include <ax25.h>
Initialize all fields of the node
n | node object to operate on. |
int iAx25NodeFilePrint | ( | const xAx25Node * | n, |
FILE * | f | ||
) |
#include <ax25.h>
Print the node in the file
n | node object to operate on. |
int iAx25NodePrint | ( | const xAx25Node * | n | ) |
#include <ax25.h>
Print the node
n | node object to operate on. |
int iAx25NodeSetCallsign | ( | xAx25Node * | n, |
const char * | callsign | ||
) |
#include <ax25.h>
Sets callsign of the node
n | node object to operate on. |
callsign | the new callsign (only the first 6 characters will be stored) |
int iAx25Read | ( | xAx25 * | ax25, |
xAx25Frame * | frame | ||
) |
#include <ax25.h>
Read the last AX25 frame received on the channel.
ax25 | AX25 object to operate on. |
frame | copy of the last received message |
int iAx25Send | ( | xAx25 * | ax25, |
const xAx25Frame * | frame | ||
) |
#include <ax25.h>
Send an AX25 frame on the channel through a specific frame.
ax25 | AX25 object to operate on. |
frame | massage to send |
int iAx25SetFdin | ( | xAx25 * | p, |
int | fdin | ||
) |
#include <ax25.h>
Sets the file descriptor used to gain access to the physical medium in input
fdin | file descriptor |
int iAx25SetFdout | ( | xAx25 * | p, |
int | fdout | ||
) |
#include <ax25.h>
Sets the file descriptor used to gain access to the physical medium in output
fdout | file descriptor |
void vAx25Delete | ( | xAx25 * | p | ) |
void vAx25FrameDelete | ( | xAx25Frame * | frame | ) |
void vAx25NodeDelete | ( | xAx25Node * | n | ) |
xAx25Frame* xAx25FrameNew | ( | void | ) |
#include <ax25.h>
Create and initialize a new xAx25Frame object
This object should be deleted with vAx25FrameDelete()
char* xAx25FrameToStr | ( | const xAx25Frame * | frame | ) |
#include <ax25.h>
Convert a frame to a string for display
frame | AX25 frame object to operate on. |
xAx25* xAx25New | ( | void | ) |
#include <ax25.h>
Create and initialize a new xAx25 object
This object should be deleted with vAx25Delete()
xAx25Node* xAx25NodeNew | ( | void | ) |
#include <ax25.h>
Create and initialize a new xAx25Node object
This object should be deleted with vAx25NodeDelete()
char* xAx25NodeToStr | ( | const xAx25Node * | p | ) |
#include <ax25.h>
Convert a node to a string for display
The format is AAAAAA-S* where AAAAAA is the callsign, S the ssid if no null and * is the has-been-repeated inficator.
n | node object to operate on. |