mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-21 11:53:56 +08:00
Add a connect only mode
This commit is contained in:
parent
86ac7d9186
commit
03ebdf91be
@ -46,7 +46,8 @@ enum {
|
||||
RECV,
|
||||
RECONNECT,
|
||||
MULTY,
|
||||
DUMP
|
||||
DUMP,
|
||||
CONNECT
|
||||
};
|
||||
|
||||
static unsigned char *buf;
|
||||
@ -334,15 +335,16 @@ static void usage(void)
|
||||
"\t-c reconnect (client)\n"
|
||||
"\t-m multiple connects (client)\n"
|
||||
"\t-r receive (server)\n"
|
||||
"\t-s send (client)\n");
|
||||
"\t-s connect and send (client)\n"
|
||||
"\t-n connect and be silent (client)\n");
|
||||
}
|
||||
|
||||
int main(int argc ,char *argv[])
|
||||
{
|
||||
struct sigaction sa;
|
||||
int opt, mode = RECV;
|
||||
int opt, sk, mode = RECV;
|
||||
|
||||
while ((opt=getopt(argc,argv,"rdscmb:")) != EOF) {
|
||||
while ((opt=getopt(argc,argv,"rdscmnb:")) != EOF) {
|
||||
switch(opt) {
|
||||
case 'r':
|
||||
mode = RECV;
|
||||
@ -364,6 +366,10 @@ int main(int argc ,char *argv[])
|
||||
mode = MULTY;
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
mode = CONNECT;
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
data_size = atoi(optarg);
|
||||
break;
|
||||
@ -411,6 +417,13 @@ int main(int argc ,char *argv[])
|
||||
case MULTY:
|
||||
multy_connect_mode(argv[optind]);
|
||||
break;
|
||||
|
||||
case CONNECT:
|
||||
sk = do_connect(argv[optind]);
|
||||
if (sk < 0)
|
||||
exit(1);
|
||||
dump_mode(sk);
|
||||
break;
|
||||
}
|
||||
|
||||
syslog(LOG_INFO, "Exit");
|
||||
|
Loading…
Reference in New Issue
Block a user