author | harlekin <harlekin> | 2002-10-12 15:44:01 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-12 15:44:01 (UTC) |
commit | e6b92ad451dba66f4eb5000a41b96eb2ee203dce (patch) (unidiff) | |
tree | 07caa3f11d59c96858dd374d6b7cff90dbe3915e /noncore/apps/opie-console/io_bt.cpp | |
parent | 83aed438ec060307bf5562d91bd8b61fe60f860b (diff) | |
download | opie-e6b92ad451dba66f4eb5000a41b96eb2ee203dce.zip opie-e6b92ad451dba66f4eb5000a41b96eb2ee203dce.tar.gz opie-e6b92ad451dba66f4eb5000a41b96eb2ee203dce.tar.bz2 |
some more stuff - modem config, bluetooth.. -, not finished
Diffstat (limited to 'noncore/apps/opie-console/io_bt.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/io_bt.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp new file mode 100644 index 0000000..8bff4df --- a/dev/null +++ b/noncore/apps/opie-console/io_bt.cpp | |||
@@ -0,0 +1,63 @@ | |||
1 | |||
2 | #include "io_bt.h" | ||
3 | |||
4 | IOBt::IOBt( const Profile &config ) : IOSerial( config ) { | ||
5 | m_attach = 0; | ||
6 | } | ||
7 | |||
8 | |||
9 | IOBt::~IOBt() { | ||
10 | if ( m_attach ) { | ||
11 | delete m_attach; | ||
12 | } | ||
13 | } | ||
14 | |||
15 | |||
16 | void IOBt::close() { | ||
17 | |||
18 | IOSerial::close(); | ||
19 | // still need error handling | ||
20 | delete m_attach; | ||
21 | } | ||
22 | |||
23 | bool IOBt::open() { | ||
24 | |||
25 | // hciattach here | ||
26 | m_attach = new OProcess(); | ||
27 | *m_attach << "hciattach /dev/ttyS2 any 57600"; | ||
28 | |||
29 | // then start hcid, then rcfomm handling (m_mac) | ||
30 | |||
31 | connect( m_attach, SIGNAL( processExited( OProcess* ) ), | ||
32 | this, SLOT( slotExited( OProcess* ) ) ); | ||
33 | |||
34 | if ( m_attach->start() ) { | ||
35 | IOSerial::open(); | ||
36 | } else { | ||
37 | qWarning("could not attach to device"); | ||
38 | delete m_attach; | ||
39 | } | ||
40 | } | ||
41 | |||
42 | void IOBt::reload( const Profile &config ) { | ||
43 | m_device = config.readEntry("Device", BT_DEFAULT_DEVICE); | ||
44 | m_mac = config.readEntry("Mac", BT_DEFAULT_MAC); | ||
45 | m_baud = config.readNumEntry("Baud", BT_DEFAULT_BAUD); | ||
46 | m_parity = config.readNumEntry("Parity", BT_DEFAULT_PARITY); | ||
47 | m_dbits = config.readNumEntry("DataBits", BT_DEFAULT_DBITS); | ||
48 | m_sbits = config.readNumEntry("StopBits", BT_DEFAULT_SBITS); | ||
49 | m_flow = config.readNumEntry("Flow", BT_DEFAULT_FLOW); | ||
50 | } | ||
51 | |||
52 | |||
53 | QString IOBt::identifier() const { | ||
54 | return "bluetooth"; | ||
55 | } | ||
56 | |||
57 | QString IOBt::name() const { | ||
58 | return "BLuetooth IO Layer"; | ||
59 | } | ||
60 | |||
61 | void IOBt::slotExited( OProcess* proc ){ | ||
62 | close(); | ||
63 | } | ||