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