SysIo  1.9.0
Embedded Library and tools
Contrôleur de noeud terminal Ax25

Detailed Description

Ce module fournit les fonctions permettant de transmettre de gérer des contrôleur de noeud terminal Ax25.
Le format des trames TNC est :

SOH STX <TXT: ASCII Hex bytes> ETX CRC3..0 EOT
Collaboration diagram for Contrôleur de noeud terminal Ax25:

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)
 
xTncxTncNew (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
}
 

Typedef Documentation

typedef struct xTnc xTnc

#include <tnc.h>

Tnc Class

Enumeration Type Documentation

enum eTncError

#include <tnc.h>

List of error codes returned by the functions.

Definition at line 43 of file tnc.h.

43  {
44 
45  TNC_SUCCESS = 0,
46  TNC_CRC_ERROR = -1,
47  TNC_NOT_ENOUGH_MEMORY = -2,
48  TNC_OBJECT_NOT_FOUND = -3,
49  TNC_ILLEGAL_MSG = -4,
50  TNC_FILE_NOT_FOUND = -5,
51  TNC_IO_ERROR = -6
52 
53 } eTncError;
eTncError
Definition: tnc.h:43

Function Documentation

int iTncClear ( xTnc p)

#include <tnc.h>

Clear all fields of the object

Returns
TNC_SUCCESS, negative value on error
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.

Parameters
tncTNC object to operate on.
Returns
true if , negative value on error
int iTncSetFdin ( xTnc p,
int  fdin 
)

#include <tnc.h>

Sets the file descriptor used to gain access to the physical medium in input

Parameters
fdinfile descriptor
Returns
xTnc initialized object, NULL if error.
int iTncSetFdout ( xTnc p,
int  fdout 
)

#include <tnc.h>

Sets the file descriptor used to gain access to the physical medium in output

Parameters
fdoutfile descriptor
Returns
xTnc initialized object, NULL if error.
ssize_t iTncWrite ( xTnc tnc,
const void *  buf,
size_t  count 
)

#include <tnc.h>

Send an TNC message

Parameters
tncTNC object to operate on.
framemessage to send
Returns
TNC_SUCCESS, negative value on error
void vTncDelete ( xTnc p)

#include <tnc.h>

Delete a xTnc object

Parameters
pobject to operate on.
xTnc* xTncNew ( size_t  iRxBufferSize)

#include <tnc.h>

Create and initialize a new xTnc object

This object should be deleted with vTncDelete()

Returns
pointer on the object, NULL on error