RCOM PROJ
File transfer via serial port
|
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 |
int main | ( | int | argc, |
char ** | argv | ||
) |
argc | valor esperado: 3 |
argv | argv[1] = receiver|transmitter argv[2]={0,1,10,11} |
References applayer, applicationLayer::gate, llclose(), llopen(), log_error(), log_success(), parseArgs(), RECEIVER, receiverApp(), TRANSMITTER, transmitterApp(), and applicationLayer::type.
void parseArgs | ( | int | argc, |
char ** | argv | ||
) |
Função para dar parse dos argumentos da linah de comandos.
argc | argc de main |
argv | argv de main |
References applayer, applicationLayer::destinationArg, applicationLayer::filenameArg, applicationLayer::gate, log_caution(), log_error(), RECEIVER, TRANSMITTER, and applicationLayer::type.
Referenced by main().
void parseFileInfo | ( | unsigned char * | controlpackage, |
int | packagesize | ||
) |
Parses the info of a Control Package to the Application Layer Struct.
controlpackage | Control Package |
References applayer, applicationLayer::filename, applicationLayer::filesize, T_NAME, and T_SIZE.
Referenced by receiverApp().
int receiverApp | ( | int | fd | ) |
Receiver part of the application.
fd | file descriptor of connection |
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().
int transmitterApp | ( | int | fd | ) |
Transmitter part of the application.
fd | file descriptor of connection |
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().
|
static |
Referenced by main(), parseArgs(), parseFileInfo(), receiverApp(), and transmitterApp().