41 lines
801 B
C
41 lines
801 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
#include <stdarg.h>
|
||
|
|
||
|
#include <patty/ax25.h>
|
||
|
|
||
|
static void usage(int argc, char **argv, const char *message, ...) {
|
||
|
if (message != NULL) {
|
||
|
va_list args;
|
||
|
|
||
|
va_start(args, message);
|
||
|
vfprintf(stderr, message, args);
|
||
|
fprintf(stderr, "\n");
|
||
|
va_end(args);
|
||
|
}
|
||
|
|
||
|
fprintf(stderr, "usage: %s /dev/ttyXX|kiss.cap\n", argv[0]);
|
||
|
|
||
|
exit(1);
|
||
|
}
|
||
|
|
||
|
int main(int argc, char **argv) {
|
||
|
patty_ax25_if *iface;
|
||
|
|
||
|
if (argc != 2) {
|
||
|
usage(argc, argv, "No TNC device or KISS dump file provided");
|
||
|
}
|
||
|
|
||
|
if ((iface = patty_ax25_if_new(PATTY_AX25_IF_KISS_TNC, argv[1])) == NULL) {
|
||
|
goto error_if_create;
|
||
|
}
|
||
|
|
||
|
patty_ax25_if_destroy(iface);
|
||
|
|
||
|
return 0;
|
||
|
|
||
|
error_if_create:
|
||
|
return 1;
|
||
|
}
|