Go to the source code of this file.
Typedefs | |
typedef struct serial_source * | serial_source |
Enumerations | |
enum | serial_source_msg { msg_unknown_packet_type, msg_ack_timeout, msg_sync, msg_too_long, msg_too_short, msg_bad_sync, msg_bad_crc, msg_closed, msg_no_memory, msg_unix_error } |
Functions | |
serial_source | open_serial_source (const char *device, int baud_rate, int non_blocking, void(*message)(serial_source_msg problem)) |
int | serial_source_fd (serial_source src) |
int | serial_source_empty (serial_source src) |
int | close_serial_source (serial_source src) |
void * | read_serial_packet (serial_source src, int *len) |
int | write_serial_packet (serial_source src, const void *packet, int len) |
typedef struct serial_source* serial_source |
Definition at line 20 of file serialsource.h.
enum serial_source_msg |
msg_unknown_packet_type | |
msg_ack_timeout | |
msg_sync | |
msg_too_long | |
msg_too_short | |
msg_bad_sync | |
msg_bad_crc | |
msg_closed | |
msg_no_memory | |
msg_unix_error |
Definition at line 23 of file serialsource.h.
int close_serial_source | ( | serial_source | src | ) |
serial_source open_serial_source | ( | const char * | device, | |
int | baud_rate, | |||
int | non_blocking, | |||
void(*)(serial_source_msg problem) | message | |||
) |
Definition at line 249 of file serialsource.c.
References fd, handle, message(), parse_baudrate(), and src.
void* read_serial_packet | ( | serial_source | src, | |
int * | len | |||
) |
Definition at line 690 of file serialsource.c.
References packet_list::len, serial_source::non_blocking, P_PACKET_NO_ACK, packet_list::packet, pop_protocol_packet(), read_and_process(), serial_source_empty(), and source_wait().
int serial_source_empty | ( | serial_source | src | ) |
Definition at line 450 of file serialsource.c.
References serial_source::bufpos, serial_source::bufused, P_PACKET_NO_ACK, packet_available(), and serial_source::recv.
int serial_source_fd | ( | serial_source | src | ) |
int write_serial_packet | ( | serial_source | src, | |
const void * | packet, | |||
int | len | |||
) |
Definition at line 816 of file serialsource.c.
References ACK_TIMEOUT, add_timeval(), dump(), dtnsim::gettimeofday(), P_ACK, P_PACKET_ACK, packet_list::packet, pop_protocol_packet(), read_and_process(), serial_source::send, serial_source::seqno, source_wait(), and write_framed_packet().