Fix serialdump code style
This commit is contained in:
parent
a8f392ffa7
commit
5c65a07c56
@ -1,4 +1,5 @@
|
||||
#define _GNU_SOURCE
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <termios.h>
|
||||
@ -9,15 +10,16 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#define BAUDRATE B115200
|
||||
#define BAUDRATE_S "115200"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifdef linux
|
||||
#define MODEMDEVICE "/dev/ttyS0"
|
||||
#else
|
||||
#define MODEMDEVICE "/dev/com1"
|
||||
#endif /* linux */
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#define SLIP_END 0300
|
||||
#define SLIP_ESC 0333
|
||||
#define SLIP_ESC_END 0334
|
||||
@ -38,9 +40,11 @@
|
||||
#define MODE_SLIP_AUTO 6
|
||||
#define MODE_SLIP 7
|
||||
#define MODE_SLIP_HIDE 8
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
static unsigned char rxbuf[2048];
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
usage(int result)
|
||||
{
|
||||
@ -54,7 +58,7 @@ usage(int result)
|
||||
printf(" (see man page for strftime() for format description)\n");
|
||||
return result;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
print_hex_line(char *prefix, unsigned char *outbuf, int index)
|
||||
{
|
||||
@ -82,13 +86,13 @@ print_hex_line(char *prefix, unsigned char *outbuf, int index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
intHandler(int sig)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
@ -174,8 +178,6 @@ main(int argc, char **argv)
|
||||
}
|
||||
fprintf(stderr, "connecting to %s (%s)", device, speedname);
|
||||
|
||||
|
||||
|
||||
#ifndef O_SYNC
|
||||
#define O_SYNC 0
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user