Diffstat (limited to 'noncore/net/opietooth/blue-pin/main.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/blue-pin/main.cc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/noncore/net/opietooth/blue-pin/main.cc b/noncore/net/opietooth/blue-pin/main.cc new file mode 100644 index 0000000..1b7daec --- a/dev/null +++ b/noncore/net/opietooth/blue-pin/main.cc | |||
@@ -0,0 +1,39 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | |||
4 | |||
5 | #include <qpe/qpeapplication.h> | ||
6 | #include <qpe/config.h> | ||
7 | |||
8 | #include "pindlg.h" | ||
9 | |||
10 | |||
11 | int main( int argc, char* argv[] ) | ||
12 | { | ||
13 | if (argc < 2 ) { | ||
14 | printf("ERR\n"); | ||
15 | exit(0); | ||
16 | } | ||
17 | QCString dir(argv[1] ); | ||
18 | QCString bdaddr( argv[2] ); | ||
19 | QCString name; | ||
20 | if ( argc > 3 ) { | ||
21 | name = argv[3]; | ||
22 | } | ||
23 | QPEApplication a(argc, argv ); | ||
24 | QString status; | ||
25 | if (dir == "out" ) { | ||
26 | status = QObject::tr("Outgoing connection to "); | ||
27 | }else | ||
28 | status = QObject::tr("Incoming connection from "); | ||
29 | status += name; | ||
30 | status += "<br>"; | ||
31 | status += "[" + bdaddr + "]"; | ||
32 | OpieTooth::PinDlg dlg( status, bdaddr ); | ||
33 | if ( dlg.exec() ) { | ||
34 | printf("PIN:%s\n", dlg.pin().stripWhiteSpace().latin1() ); | ||
35 | }else | ||
36 | printf("ERR\n"); | ||
37 | return 0; | ||
38 | } | ||
39 | |||