RCOM PROJ
File transfer via serial port
|
Data Structures | |
struct | linkLayer |
Struct to hold information about the Link Layer. More... | |
Functions | |
int | llopen (int porta, int type) |
Opens a data connection with the serial port. More... | |
int | llwrite (int fd, char *buffer, int lenght) |
Writes the content of buffer to fd. More... | |
int | llread (int fd, unsigned char *buffer) |
Reads from fd to buffer. More... | |
int | llclose (int fd) |
Closes the connection to the serial port. More... | |
Variables | |
static struct sigaction | old_action |
sigaction to restore SIGALRN handler More... | |
int | testSend =0 |
struct linkLayer | linkLayer |
Data relative to the link layer. More... | |
struct termios | oldtio |
used in llclose to reset termios More... | |
volatile int | failed |
used in the alarm handler More... | |
int llclose | ( | int | fd | ) |
Closes the connection to the serial port.
fd | data connection identifier |
References log_error(), log_success(), old_action, oldtio, RECEIVER, receiver_DISC_UA(), linkLayer::status, TRANSMITTER, and transmitter_DISC_UA().
Referenced by main().
int llopen | ( | int | porta, |
int | type | ||
) |
Opens a data connection with the serial port.
porta | number of the port x in "/dev/ttySx" |
type | TRANSMITTER|RECEIVER |
References atende(), initConnection(), log_error(), old_action, RECEIVER, receiver_UA(), linkLayer::status, TRANSMITTER, and transmitter_SET().
Referenced by main().
int llread | ( | int | fd, |
unsigned char * | buffer | ||
) |
Reads from fd to buffer.
fd | data connection identifier |
buffer | character array of received data |
References A_ER, BCC, C_I, FLAG, log_error(), Read, readingCycle(), readR, linkLayer::sequenceNumber, Start, and stateMachineSetUp().
Referenced by receiverApp().
int llwrite | ( | int | fd, |
char * | buffer, | ||
int | lenght | ||
) |
Writes the content of buffer to fd.
fd | data connection identifier |
buffer | character array of data to send |
lenght | array's size |
References A_ER, BCC, C_I, C_RR, fillFinalBuffer(), FLAG, log_error(), MAX_SIZE, linkLayer::sequenceNumber, Start, stateMachineSetUp(), Write, writeCycle(), and writeR.
Referenced by transmitterApp().
volatile int failed |
used in the alarm handler
Referenced by atende(), transmitter_DISC_UA(), transmitter_SET(), and writeCycle().
|
static |
struct termios oldtio |
used in llclose to reset termios
Referenced by initConnection(), and llclose().
int testSend =0 |