diff --git a/tools/l2test.c b/tools/l2test.c
index 8065578..75603a8 100644
--- a/tools/l2test.c
+++ b/tools/l2test.c
/* Default delay before receiving */
static unsigned long recv_delay = 0;
+/* Initial sequence value when sending frames */
+static int seq_start = 0;
+
static char *filename = NULL;
static int rfcmode = 0;
buf[i] = 0x7f;
}
- seq = 0;
+ seq = seq_start;
while ((num_frames == -1) || (num_frames-- > 0)) {
put_le32(seq, buf);
put_le16(data_size, buf + 4);
size -= len;
}
- if (num_frames && send_delay && count && !(seq % count))
+ if (num_frames && send_delay && count &&
+ !(seq % (count + seq_start)))
usleep(send_delay);
}
}
"\t[-S] secure connection\n"
"\t[-M] become master\n"
"\t[-T] enable timestamps\n"
- "\t[-V type] address type (help for list, default = bredr)\n");
+ "\t[-V type] address type (help for list, default = bredr)\n"
+ "\t[-e seq] initial sequence value (default = 0)\n");
}
int main(int argc, char *argv[])
bacpy(&bdaddr, BDADDR_ANY);
while ((opt = getopt(argc, argv, "rdscuwmntqxyzpb:a:"
- "i:P:I:O:J:B:N:L:W:C:D:X:F:Q:Z:Y:H:K:V:RUGAESMT")) != EOF) {
+ "i:P:I:O:J:B:N:L:W:C:D:X:F:Q:Z:Y:H:K:V:RUGAESMTe:")) != EOF) {
switch (opt) {
case 'r':
mode = RECV;
break;
+ case 'e':
+ seq_start = atoi(optarg);
+ break;
+
default:
usage();
exit(1);