diff --git a/monitor/main.c b/monitor/main.c
index 4e32f22..8a12a6d 100644
--- a/monitor/main.c
+++ b/monitor/main.c
"\t-r, --read <file> Read traces in btsnoop format\n"
"\t-w, --write <file> Save traces in btsnoop format\n"
"\t-s, --server <socket> Start monitor server socket\n"
+ "\t-t, --time Show time instead of time offset\n"
+ "\t-T, --date Show time and date information\n"
"\t-h, --help Show help options\n");
}
{ "read", required_argument, NULL, 'r' },
{ "write", required_argument, NULL, 'b' },
{ "server", required_argument, NULL, 'r' },
+ { "time", no_argument, NULL, 't' },
+ { "date", no_argument, NULL, 'T' },
{ "version", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
{ }
mainloop_init();
+ filter_mask |= PACKET_FILTER_SHOW_TIME_OFFSET;
+
for (;;) {
int opt;
- opt = getopt_long(argc, argv, "r:w:s:vh", main_options, NULL);
+ opt = getopt_long(argc, argv, "r:w:s:tTvh",
+ main_options, NULL);
if (opt < 0)
break;
case 's':
control_server(optarg);
break;
+ case 't':
+ filter_mask &= ~PACKET_FILTER_SHOW_TIME_OFFSET;
+ filter_mask |= PACKET_FILTER_SHOW_TIME;
+ break;
+ case 'T':
+ filter_mask &= ~PACKET_FILTER_SHOW_TIME_OFFSET;
+ filter_mask |= PACKET_FILTER_SHOW_TIME;
+ filter_mask |= PACKET_FILTER_SHOW_DATE;
+ break;
case 'v':
printf("%s\n", VERSION);
return EXIT_SUCCESS;
mainloop_set_signal(&mask, signal_callback, NULL, NULL);
- filter_mask |= PACKET_FILTER_SHOW_TIME_OFFSET;
+ printf("Bluetooth monitor ver %s\n", VERSION);
packet_set_filter(filter_mask);
- printf("Bluetooth monitor ver %s\n", VERSION);
-
if (reader_path) {
control_reader(reader_path);
return EXIT_SUCCESS;
diff --git a/monitor/packet.c b/monitor/packet.c
index 59213e4..d90dc24 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
const char *text, const char *extra)
{
int col = num_columns();
- char line[252], ts_str[48];
+ char line[256], ts_str[64];
int n, ts_len = 0, ts_pos = 0, len = 0, pos = 0;
if (filter_mask & PACKET_FILTER_SHOW_INDEX) {