author | wimpie <wimpie> | 2005-01-07 01:19:13 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-07 01:19:13 (UTC) |
commit | 7af7203a51ddcf85f9f60e39157fcad21f7d9e34 (patch) (unidiff) | |
tree | 49829585a0100a5a741d55424f86be39c01d3150 /noncore/settings/networksettings2/bluetooth | |
parent | a8e5ecd107a79f940d8a99d4a77071606a3a932f (diff) | |
download | opie-7af7203a51ddcf85f9f60e39157fcad21f7d9e34.zip opie-7af7203a51ddcf85f9f60e39157fcad21f7d9e34.tar.gz opie-7af7203a51ddcf85f9f60e39157fcad21f7d9e34.tar.bz2 |
First implementation of plugins
THIS VERSION DOES NOT COMPILE
Diffstat (limited to 'noncore/settings/networksettings2/bluetooth') (more/less context) (show whitespace changes)
7 files changed, 26 insertions, 7 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth.pro b/noncore/settings/networksettings2/bluetooth/bluetooth.pro index 2e3b5bb..053a6cb 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetooth.pro +++ b/noncore/settings/networksettings2/bluetooth/bluetooth.pro | |||
@@ -1,8 +1,8 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release plugin |
3 | DESTDIR = $(OPIEDIR)/plugins/networksettings2 | 3 | DESTDIR = $(OPIEDIR)/plugins/networksettings2 |
4 | HEADERS = bluetoothBNEP_NN.h \ | 4 | HEADERS = bluetoothBNEP_NN.h \ |
5 | bluetoothBNEP_NNI.h \ | 5 | bluetoothBNEP_NNI.h \ |
6 | bluetoothRFCOMM_NN.h \ | 6 | bluetoothRFCOMM_NN.h \ |
7 | bluetoothRFCOMM_NNI.h \ | 7 | bluetoothRFCOMM_NNI.h \ |
8 | bluetoothBNEPedit.h \ | 8 | bluetoothBNEPedit.h \ |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp index ee3e92b..5e4d951 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp | |||
@@ -1,10 +1,16 @@ | |||
1 | #include "bluetoothBNEP_NN.h" | 1 | #include "bluetoothBNEP_NN.h" |
2 | #include "bluetoothBNEP_NNI.h" | 2 | #include "bluetoothBNEP_NNI.h" |
3 | #include "bluetoothRFCOMM_NNI.h" | 3 | #include "bluetoothRFCOMM_NNI.h" |
4 | 4 | ||
5 | #ifndef MYPLUGIN | ||
6 | |||
7 | #include "netnodeinterface.h" | ||
8 | |||
9 | #endif | ||
10 | |||
5 | // | 11 | // |
6 | // | 12 | // |
7 | // BLUETOOTH PAN/NAP node | 13 | // BLUETOOTH PAN/NAP node |
8 | // | 14 | // |
9 | // | 15 | // |
10 | 16 | ||
@@ -66,13 +72,23 @@ void BluetoothBNEPNetNode::setSpecificAttribute( QString & A, QString & V ) { | |||
66 | void BluetoothBNEPNetNode::saveSpecificAttribute( QTextStream & TS) { | 72 | void BluetoothBNEPNetNode::saveSpecificAttribute( QTextStream & TS) { |
67 | TS << "interfacecount=" | 73 | TS << "interfacecount=" |
68 | << InstanceCount | 74 | << InstanceCount |
69 | << endl; | 75 | << endl; |
70 | } | 76 | } |
71 | 77 | ||
78 | #ifndef MYPLUGIN | ||
79 | |||
72 | extern "C" { | 80 | extern "C" { |
73 | // create plugin registers both BT functions | 81 | // create plugin registers both BT functions |
74 | void create_plugin( QList<ANetNode> & PNN ) { | 82 | void create_plugin( QList<ANetNode> & PNN ) { |
75 | PNN.append( new BluetoothBNEPNetNode() ); | 83 | PNN.append( new BluetoothBNEPNetNode() ); |
76 | PNN.append( new BluetoothRFCOMMNetNode() ); | 84 | PNN.append( new BluetoothRFCOMMNetNode() ); |
77 | } | 85 | } |
86 | |||
87 | #else | ||
88 | |||
89 | typedef Opie::Core::MakeTypelist<BluetoothBNEPNetNode, BluetoothRFCOMMNetNode>::Result BluetoothTypes; | ||
90 | OPIE_NS2_PLUGIN( NetNodeInterface<BluetoothTypes> ) | ||
91 | |||
92 | #endif | ||
93 | |||
78 | } | 94 | } |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp index 9d4ae97..5c937a1 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp | |||
@@ -1,12 +1,16 @@ | |||
1 | #include <qfile.h> | 1 | #include <qfile.h> |
2 | #include <qfileinfo.h> | 2 | #include <qfileinfo.h> |
3 | #include <qtextstream.h> | 3 | #include <qtextstream.h> |
4 | #include <resources.h> | 4 | #include <resources.h> |
5 | #include "bluetoothBNEPrun.h" | 5 | #include "bluetoothBNEPrun.h" |
6 | 6 | ||
7 | using Opietooth2::OTGateway; | ||
8 | using Opietooth2::OTPANConnection; | ||
9 | using Opietooth2::PANConnectionVector; | ||
10 | |||
7 | BluetoothBNEPRun::BluetoothBNEPRun( ANetNodeInstance * NNI, | 11 | BluetoothBNEPRun::BluetoothBNEPRun( ANetNodeInstance * NNI, |
8 | BluetoothBNEPData & D ) : | 12 | BluetoothBNEPData & D ) : |
9 | RuntimeInfo( NNI ), | 13 | RuntimeInfo( NNI ), |
10 | Data( D), | 14 | Data( D), |
11 | Pat( "bnep[0-6]" ) { | 15 | Pat( "bnep[0-6]" ) { |
12 | OT = 0; | 16 | OT = 0; |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h index a05a7a2..8551a2e 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h | |||
@@ -1,11 +1,10 @@ | |||
1 | #include <netnode.h> | 1 | #include <netnode.h> |
2 | #include "bluetoothBNEPdata.h" | 2 | #include "bluetoothBNEPdata.h" |
3 | 3 | ||
4 | #include <OTGateway.h> | 4 | #include <OTGateway.h> |
5 | using namespace Opietooth2; | ||
6 | 5 | ||
7 | class BluetoothBNEPRun : public RuntimeInfo { | 6 | class BluetoothBNEPRun : public RuntimeInfo { |
8 | 7 | ||
9 | public : | 8 | public : |
10 | 9 | ||
11 | BluetoothBNEPRun( ANetNodeInstance * NNI, | 10 | BluetoothBNEPRun( ANetNodeInstance * NNI, |
@@ -27,9 +26,9 @@ protected : | |||
27 | 26 | ||
28 | private : | 27 | private : |
29 | 28 | ||
30 | bool hasFreePANConnection( bool Grab = 0 ); | 29 | bool hasFreePANConnection( bool Grab = 0 ); |
31 | 30 | ||
32 | BluetoothBNEPData & Data; | 31 | BluetoothBNEPData & Data; |
33 | OTGateway * OT; | 32 | Opietooth2::OTGateway * OT; |
34 | QRegExp Pat; | 33 | QRegExp Pat; |
35 | }; | 34 | }; |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h index 9ad8f2a..fe474fc 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h | |||
@@ -1,11 +1,10 @@ | |||
1 | #include "bluetoothRFCOMMdata.h" | 1 | #include "bluetoothRFCOMMdata.h" |
2 | #include "bluetoothRFCOMMGUI.h" | 2 | #include "bluetoothRFCOMMGUI.h" |
3 | 3 | ||
4 | #include <Opietooth.h> | 4 | #include <Opietooth.h> |
5 | using namespace Opietooth2; | ||
6 | 5 | ||
7 | class BluetoothRFCOMMEdit : public BluetoothRFCOMMGUI { | 6 | class BluetoothRFCOMMEdit : public BluetoothRFCOMMGUI { |
8 | 7 | ||
9 | public : | 8 | public : |
10 | 9 | ||
11 | BluetoothRFCOMMEdit( QWidget * parent ); | 10 | BluetoothRFCOMMEdit( QWidget * parent ); |
@@ -13,13 +12,13 @@ public : | |||
13 | 12 | ||
14 | QString acceptable( void ); | 13 | QString acceptable( void ); |
15 | void showData( BluetoothRFCOMMData & Data ); | 14 | void showData( BluetoothRFCOMMData & Data ); |
16 | bool commit( BluetoothRFCOMMData & Data ); | 15 | bool commit( BluetoothRFCOMMData & Data ); |
17 | 16 | ||
18 | bool Modified; | 17 | bool Modified; |
19 | OTGateway * OT; | 18 | Opietooth2::OTGateway * OT; |
20 | 19 | ||
21 | public slots : | 20 | public slots : |
22 | 21 | ||
23 | void SLOT_AddServer( void ); | 22 | void SLOT_AddServer( void ); |
24 | void SLOT_RemoveServer( void ); | 23 | void SLOT_RemoveServer( void ); |
25 | void SLOT_FindDevice( void ); | 24 | void SLOT_FindDevice( void ); |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp index 1e91ed1..ef6878a 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp | |||
@@ -1,13 +1,15 @@ | |||
1 | #include <qapplication.h> | 1 | #include <qapplication.h> |
2 | #include <resources.h> | 2 | #include <resources.h> |
3 | #include <OTDevice.h> | 3 | #include <OTDevice.h> |
4 | #include <OTGateway.h> | 4 | #include <OTGateway.h> |
5 | #include "bluetoothRFCOMMrun.h" | 5 | #include "bluetoothRFCOMMrun.h" |
6 | 6 | ||
7 | using namespace Opietooth2; | 7 | using Opietooth2::OTGateway; |
8 | using Opietooth2::OTDevice; | ||
9 | using Opietooth2::OTDeviceAddress; | ||
8 | 10 | ||
9 | BluetoothRFCOMMRun::~BluetoothRFCOMMRun( void ) { | 11 | BluetoothRFCOMMRun::~BluetoothRFCOMMRun( void ) { |
10 | if( OT ) { | 12 | if( OT ) { |
11 | OTGateway::releaseOTGateway(); | 13 | OTGateway::releaseOTGateway(); |
12 | } | 14 | } |
13 | } | 15 | } |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h index 24e3dae..5a31a94 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h | |||
@@ -1,11 +1,10 @@ | |||
1 | #include <netnode.h> | 1 | #include <netnode.h> |
2 | #include "bluetoothRFCOMMdata.h" | 2 | #include "bluetoothRFCOMMdata.h" |
3 | 3 | ||
4 | #include <OTGateway.h> | 4 | #include <OTGateway.h> |
5 | using namespace Opietooth2; | ||
6 | 5 | ||
7 | class BluetoothRFCOMMRun : public RuntimeInfo { | 6 | class BluetoothRFCOMMRun : public RuntimeInfo { |
8 | 7 | ||
9 | public : | 8 | public : |
10 | 9 | ||
11 | BluetoothRFCOMMRun( ANetNodeInstance * NNI, | 10 | BluetoothRFCOMMRun( ANetNodeInstance * NNI, |