summaryrefslogtreecommitdiff
path: root/monitor/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor/main.c')
-rwxr-xr-xmonitor/main.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/monitor/main.c b/monitor/main.c
index f9bca221..57830ada 100755
--- a/monitor/main.c
+++ b/monitor/main.c
@@ -70,6 +70,10 @@ static void usage(void)
"\t-T, --date Show time and date information\n"
"\t-S, --sco Dump SCO traffic\n"
"\t-E, --ellisys [ip] Send Ellisys HCI Injection\n"
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ "\t-C, --count <num> Save traces by <num> rotation\n"
+ "\t-W, --size <num> Save traces at most <num> size\n"
+#endif
"\t-h, --help Show help options\n");
}
@@ -86,6 +90,10 @@ static const struct option main_options[] = {
{ "date", no_argument, NULL, 'T' },
{ "sco", no_argument, NULL, 'S' },
{ "ellisys", required_argument, NULL, 'E' },
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ { "count", required_argument, NULL, 'C' },
+ { "size", required_argument, NULL, 'W' },
+#endif
{ "todo", no_argument, NULL, '#' },
{ "version", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
@@ -102,6 +110,10 @@ int main(int argc, char *argv[])
const char *tty = NULL;
unsigned int tty_speed = B115200;
unsigned short ellisys_port = 0;
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ int16_t rotate_count = -1;
+ ssize_t file_size = -1;
+#endif
const char *str;
int exit_status;
sigset_t mask;
@@ -113,8 +125,13 @@ int main(int argc, char *argv[])
for (;;) {
int opt;
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ opt = getopt_long(argc, argv, "d:r:w:a:s:p:i:tTSE:C:W:vh",
+ main_options, NULL);
+#else
opt = getopt_long(argc, argv, "d:r:w:a:s:p:i:tTSE:vh",
main_options, NULL);
+#endif
if (opt < 0)
break;
@@ -171,6 +188,14 @@ int main(int argc, char *argv[])
ellisys_server = optarg;
ellisys_port = 24352;
break;
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ case 'C':
+ rotate_count = atoi(optarg);
+ break;
+ case 'W':
+ file_size = atoll(optarg);
+ break;
+#endif
case '#':
packet_todo();
lmp_todo();
@@ -221,10 +246,18 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ if (writer_path && !control_writer(writer_path,
+ rotate_count, file_size)) {
+ printf("Failed to open '%s'\n", writer_path);
+ return EXIT_FAILURE;
+ }
+#else
if (writer_path && !control_writer(writer_path)) {
printf("Failed to open '%s'\n", writer_path);
return EXIT_FAILURE;
}
+#endif
if (ellisys_server)
ellisys_enable(ellisys_server, ellisys_port);