summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Krasnyansky <maxk@qualcomm.com>2002-03-18 19:39:45 +0000
committerMax Krasnyansky <maxk@qualcomm.com>2002-03-18 19:39:45 +0000
commitaba9dc216df7ddacbaa10d9e25c7aba05ab28afb (patch)
tree6940568025f1c72f9ad62e3957e9b47369cef11a
parent50fc3563a46bb0b217b0b3ab941b8b7c012073e1 (diff)
Don't foget to compile l2test.
l2test output nicefication :)
-rw-r--r--tools/Makefile.am8
-rw-r--r--tools/Makefile.in12
-rw-r--r--tools/l2test.c28
3 files changed, 31 insertions, 17 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am
index d3133e5f..53e3e21d 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -8,3 +8,11 @@ sbin_PROGRAMS = hciattach hciconfig
bin_PROGRAMS = hcitool l2ping
man_MANS = hciattach.8 l2ping.8
+
+CLEANFILES = l2test.o l2test
+
+
+all-local: l2test
+
+l2test: l2test.o
+ $(LINK) l2test.o $(LDFLAGS) $(LIBS)
diff --git a/tools/Makefile.in b/tools/Makefile.in
index fe838a44..fae41912 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -87,6 +87,8 @@ sbin_PROGRAMS = hciattach hciconfig
bin_PROGRAMS = hcitool l2ping
man_MANS = hciattach.8 l2ping.8
+
+CLEANFILES = l2test.o l2test
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS)
@@ -368,7 +370,7 @@ install-am: all-am
install: install-am
uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS uninstall-man
uninstall: uninstall-am
-all-am: Makefile $(PROGRAMS) $(MANS)
+all-am: Makefile $(PROGRAMS) $(MANS) all-local
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
@@ -380,6 +382,7 @@ installdirs:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
@@ -423,11 +426,16 @@ clean-tags maintainer-clean-tags distdir mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
install-exec install-data-am install-data install-am install \
-uninstall-am uninstall all-redirect all-am all installdirs \
+uninstall-am uninstall all-local all-redirect all-am all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+all-local: l2test
+
+l2test: l2test.o
+ $(LINK) l2test.o $(LDFLAGS) $(LIBS)
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/tools/l2test.c b/tools/l2test.c
index be0b59e1..e527fc60 100644
--- a/tools/l2test.c
+++ b/tools/l2test.c
@@ -292,10 +292,8 @@ void send_mode(char *svr)
uint32_t seq;
int s, i;
- if( (s = do_connect(svr)) < 0 ){
- syslog(LOG_ERR, "Can't connect to the server. %s(%d)", strerror(errno), errno);
+ if( (s = do_connect(svr)) < 0 )
exit(1);
- }
syslog(LOG_INFO,"Sending ...");
@@ -318,10 +316,9 @@ void reconnect_mode(char *svr)
{
while(1){
int s;
- if( (s = do_connect(svr)) < 0 ){
- syslog(LOG_ERR, "Can't connect to the server. %s(%d)", strerror(errno), errno);
+ if( (s = do_connect(svr)) < 0 )
exit(1);
- }
+
close(s);
usleep(10);
@@ -331,11 +328,8 @@ void reconnect_mode(char *svr)
void connect_mode(char *svr)
{
int s;
- if ((s = do_connect(svr)) < 0) {
- syslog(LOG_ERR, "Can't connect to the server. %s(%d)",
- strerror(errno), errno);
+ if ((s = do_connect(svr)) < 0)
exit(1);
- }
sleep(99999999);
}
@@ -347,9 +341,7 @@ void multy_connect_mode(char *svr)
if( fork() ) continue;
/* Child */
- if( (s = do_connect(svr)) < 0 ){
- syslog(LOG_ERR, "Can't connect to the server. %s(%d)", strerror(errno), errno);
- }
+ s = do_connect(svr);
close(s);
exit(0);
}
@@ -361,14 +353,20 @@ void usage(void)
{
printf("l2test - L2CAP testing\n"
"Usage:\n");
- printf("\tl2test <mode> [-b bytes] [-S bd_addr] [-P psm] [-I imtu] [-O omtu] [-M] [bd_addr]\n");
+ printf("\tl2test <mode> [options] [bdaddr]\n");
printf("Modes:\n"
+ "\t-r receive (server)\n"
"\t-d dump (server)\n"
"\t-n silent connect (client)\n"
"\t-c reconnect (client)\n"
"\t-m multiple connects (client)\n"
- "\t-r receive (server)\n"
"\t-s send (client)\n");
+ printf("Options:\n"
+ "\t[-b bytes] [-S bdaddr] [-P psm]\n"
+ "\t[-I imtu] [-O omtu]\n"
+ "\t[-A] request authentication\n"
+ "\t[-E] request encryption\n"
+ "\t[-M] become master\n");
}
extern int optind,opterr,optopt;