CAX25Server

The CAX25Server class realises an AX25 server socket.

Header: #include „cax25server.h“

qmake: qt += core

Detailed Description

The CAX25Server class realises an AX25 server socket. Before an instance of CAX25Server can be created an AX25 layer 1 socket has to be created. CAX25Server needs a pointer to an AX25 frame scheduler object which can be gotten by CAx25L1Socket::GetScheduler().

To start an AX25 server an object of CAX25Server has to be created. CAX25Server needs a pointer to an Frame scheduler either as parameter of the constructor or later on as paramter of CAX25Server::setFrameSchedule( CAX25FrameSchedule* ).

The server is started with CAX25Server::listen( const QString& ). The parameter must be the local callsign of the server.

When a peer connects the listening server a CAX25Server::newConnection() signal is emitted and a socket to the new connected can be gotten by CAX25Server::nextPendingConnection().

Member Function documentation

Constructors and destructors

CAX25Server( QObject *ptParent = NULL )

Constructs an object of CAX25Server. A pointer to the parent object is given as parameter.

CAX25Server( CAX25FrameSchedule *ptSchedule, QObject *ptParent = NULL )

Constructs an object of CAX25Server. ptSchedule is a pointer to an AX25 frame scheduler and ptParent is a pointer to a parent object.

~CAX25Server( void )

The destructor of an AX25 server.

Signals

void newConnection( void )

newConnection() is emitted when the server was connected by a peer. A socket to the new connected cyn be gotten by nextPendingConnection().

Public Slots

void AX25Connect( const QString &SDummy )

For internal use only!

Public Member Functions

void setFrameSchedule( CAX25FrameSchedule *ptSchedule )

This function assosiates a new frame scheduler to the server. ptSchedule is a pointer to a frame scheduler.

bool has PendingConnections( void ) const

This function checks whether a new connection is pending and returns true if it is. In this case a pointer to a socket of this new connection can be gotten by CAX25Server::nextPendingConnection().

bool isListening( void ) const

Returns whether the server is listening.

void listen( const QString &SLocalCallsign )

sets the server to listen mode. SLocalCallsign is the local callsign the server starts to listen with.

CAX25Socket* nextPendingConnection( void )

If a new AX25 connection is available this function returns a pointer to an AX25 socket object.

 

Schreibe einen Kommentar