Thread (74 messages) flat view 74 messages, 4 authors, 2003-06-13

RE: [Bluez-devel] Qualification Testing

From: Daryl Van Vorst <hidden>
Date: 2003-05-14 22:35:29

Here you go (sorry about that):
--- /home/daryl/bluez/bluez-utils-2.3/test/l2test.c	Wed May 14 15:11:32
2003
+++ l2test.c	Wed May 14 15:10:58 2003
@@ -71,6 +71,9 @@
 bdaddr_t bdaddr;
 unsigned short psm = 10;
 
+/* Default number of blocks to send */
+int num_blocks = -1; // Infinite
+
 int master = 0;
 int auth = 0;
 int encrypt = 0;
@@ -324,7 +327,7 @@
 		buf[i]=0x7f;
 
 	seq = 0;
-	while (1) {
+	while ((num_blocks == -1) || (num_blocks-- > 0)) {
 		*(uint32_t *) buf = htobl(seq++);
 		*(uint16_t *)(buf+4) = htobs(data_size);
 		
@@ -386,9 +389,9 @@
 	printf("Options:\n"
 		"\t[-b bytes] [-S bdaddr] [-P psm]\n"
 	       	"\t[-I imtu] [-O omtu]\n"
+	        "\t[-N num] send num blocks (default = infinite)\n"
 		"\t[-D] use connectionless channel (datagram)\n"
 		"\t[-E] request encryption\n"
-		"\t[-E] request encryption\n"
 	       	"\t[-M] become master\n");
 }
 
@@ -402,7 +405,7 @@
 
 	mode = RECV; need_addr = 0;
 	
-	while ((opt=getopt(argc,argv,"rdscuwmnb:P:I:O:S:MAED")) != EOF) {
+	while ((opt=getopt(argc,argv,"rdscuwmnb:P:I:O:S:N:MAED")) != EOF) {
 		switch(opt) {
 		case 'r':
 			mode = RECV;
@@ -477,6 +480,10 @@
 			socktype = SOCK_DGRAM;
 			break;
 
+		case 'N':
+			num_blocks = atoi(optarg);
+			break;
+
 		default:
 			usage();
 			exit(1);
-----Original Message-----
From: Marcel Holtmann [mailto:marcel@rvs.uni-bielefeld.de] 
Sent: May 14, 2003 3:27 PM
To: Daryl Van Vorst
Cc: 'Max Krasnyansky'; 'BlueZ Mailing List'
Subject: RE: [Bluez-devel] Qualification Testing


Hi Daryl,
quoted
Got to it a bit quicker than expected. I haven't needed to change 
rctest for testing, so I haven't modified that one yet.

Here's the diff.
thats great, but can you please use "diff -urN". Because a 
unified diff is much more easier to read.

Regards

Marcel

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help