RCOM PROJ
File transfer via serial port
Application

Data Structures

struct  applicationLayer
 Struct to save data relative to the Application. More...
 

Functions

void parseArgs (int argc, char **argv)
 Função para dar parse dos argumentos da linah de comandos. More...
 
int transmitterApp (int fd)
 Transmitter part of the application. More...
 
void parseFileInfo (unsigned char *controlpackage, int packagesize)
 Parses the info of a Control Package to the Application Layer Struct. More...
 
int receiverApp (int fd)
 Receiver part of the application. More...
 
int main (int argc, char **argv)
 

Variables

static struct applicationLayer applayer
 

Detailed Description

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)
Parameters
argcvalor esperado: 3
argvargv[1] = receiver|transmitter argv[2]={0,1,10,11}
Returns
int

References applayer, applicationLayer::gate, llclose(), llopen(), log_error(), log_success(), parseArgs(), RECEIVER, receiverApp(), TRANSMITTER, transmitterApp(), and applicationLayer::type.

Here is the call graph for this function:

◆ parseArgs()

void parseArgs ( int  argc,
char **  argv 
)

Função para dar parse dos argumentos da linah de comandos.

Parameters
argcargc de main
argvargv de main

References applayer, applicationLayer::destinationArg, applicationLayer::filenameArg, applicationLayer::gate, log_caution(), log_error(), RECEIVER, TRANSMITTER, and applicationLayer::type.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseFileInfo()

void parseFileInfo ( unsigned char *  controlpackage,
int  packagesize 
)

Parses the info of a Control Package to the Application Layer Struct.

Parameters
controlpackageControl Package

References applayer, applicationLayer::filename, applicationLayer::filesize, T_NAME, and T_SIZE.

Referenced by receiverApp().

Here is the caller graph for this function:

◆ receiverApp()

int receiverApp ( int  fd)

Receiver part of the application.

Parameters
fdfile descriptor of connection
Returns
int 0 if all okay, negative otherwise

References applayer, clearProgressBar(), DATA, applicationLayer::destinationArg, END, applicationLayer::filename, applicationLayer::filesize, llread(), log_caution(), log_error(), MAX_SIZE, parseFileInfo(), printProgressBar(), and START.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transmitterApp()

int transmitterApp ( int  fd)

Transmitter part of the application.

Parameters
fdfile descriptor of connection
Returns
int 0 if all okay, negative otherwise

References applayer, clearProgressBar(), DATA, END, applicationLayer::filenameArg, llwrite(), log_bitsPerSecond(), log_elapsedTime(), log_error(), MAX_SIZE, printProgressBar(), START, startTime(), T_NAME, and T_SIZE.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ applayer

struct applicationLayer applayer
static