![]() |
SysIo
1.9.0
Embedded Library and tools
|
Ce module fournit les fonctions permettant de transmettre de gérer des contrôleur de noeud terminal Ax25.
Le format des trames TNC est :
![]() |
Modules | |
Interface C++ | |
Classes | |
struct | xTnc |
Functions | |
int | iTncClear (xTnc *p) |
int | iTncError (xTnc *tnc) |
int | iTncPoll (xTnc *tnc) |
int | iTncSetFdin (xTnc *p, int fdin) |
int | iTncSetFdout (xTnc *p, int fdout) |
ssize_t | iTncWrite (xTnc *tnc, const void *buf, size_t count) |
void | vTncDelete (xTnc *p) |
xTnc * | xTncNew (size_t iRxBufferSize) |
Macros | |
#define | TNC_CRC 6 |
#define | TNC_EOT 4 |
#define | TNC_ETX 3 |
#define | TNC_SOH 1 |
#define | TNC_STX 2 |
#define | TNC_TXT 5 |
Typedefs | |
typedef struct xTnc | xTnc |
Enumerations | |
enum | eTncError { TNC_SUCCESS = 0, TNC_CRC_ERROR = -1, TNC_NOT_ENOUGH_MEMORY = -2, TNC_OBJECT_NOT_FOUND = -3, TNC_ILLEGAL_MSG = -4, TNC_FILE_NOT_FOUND = -5, TNC_IO_ERROR = -6 } |
enum eTncError |
#include <tnc.h>
List of error codes returned by the functions.
int iTncClear | ( | xTnc * | p | ) |
#include <tnc.h>
Clear all fields of the object
int iTncError | ( | xTnc * | tnc | ) |
#include <tnc.h>
Returns the last error code.
int iTncPoll | ( | xTnc * | tnc | ) |
#include <tnc.h>
Check if there are any TNC messages to be processed. This function read available characters from the medium and search for any TNC messages. If a message is found, this function return true and the message can be read with iTncRead(). This function may be blocking if there are no available chars and the FILE used in tnc to access the medium is configured in blocking mode.
tnc | TNC object to operate on. |
int iTncSetFdin | ( | xTnc * | p, |
int | fdin | ||
) |
#include <tnc.h>
Sets the file descriptor used to gain access to the physical medium in input
fdin | file descriptor |
int iTncSetFdout | ( | xTnc * | p, |
int | fdout | ||
) |
#include <tnc.h>
Sets the file descriptor used to gain access to the physical medium in output
fdout | file descriptor |
ssize_t iTncWrite | ( | xTnc * | tnc, |
const void * | buf, | ||
size_t | count | ||
) |
#include <tnc.h>
Send an TNC message
tnc | TNC object to operate on. |
frame | message to send |
xTnc* xTncNew | ( | size_t | iRxBufferSize | ) |
#include <tnc.h>
Create and initialize a new xTnc object
This object should be deleted with vTncDelete()