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/bluetoothBNEP_NN.cpp | |
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/bluetoothBNEP_NN.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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,28 +1,34 @@ | |||
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 | ||
11 | static const char * BluetoothBNEPNeeds[] = | 17 | static const char * BluetoothBNEPNeeds[] = |
12 | { 0 | 18 | { 0 |
13 | }; | 19 | }; |
14 | 20 | ||
15 | static const char * BluetoothBNEPProvides[] = | 21 | static const char * BluetoothBNEPProvides[] = |
16 | { "device", | 22 | { "device", |
17 | 0 | 23 | 0 |
18 | }; | 24 | }; |
19 | 25 | ||
20 | /** | 26 | /** |
21 | * Constructor, find all of the possible interfaces | 27 | * Constructor, find all of the possible interfaces |
22 | */ | 28 | */ |
23 | BluetoothBNEPNetNode::BluetoothBNEPNetNode() : | 29 | BluetoothBNEPNetNode::BluetoothBNEPNetNode() : |
24 | ANetNode(tr("Bluetooth PAN/NAP")) { | 30 | ANetNode(tr("Bluetooth PAN/NAP")) { |
25 | InstanceCount = 7; // default | 31 | InstanceCount = 7; // default |
26 | } | 32 | } |
27 | 33 | ||
28 | /** | 34 | /** |
@@ -48,31 +54,41 @@ const char ** BluetoothBNEPNetNode::needs( void ) { | |||
48 | } | 54 | } |
49 | 55 | ||
50 | const char ** BluetoothBNEPNetNode::provides( void ) { | 56 | const char ** BluetoothBNEPNetNode::provides( void ) { |
51 | return BluetoothBNEPProvides; | 57 | return BluetoothBNEPProvides; |
52 | } | 58 | } |
53 | 59 | ||
54 | QString BluetoothBNEPNetNode::genNic( long nr ) { | 60 | QString BluetoothBNEPNetNode::genNic( long nr ) { |
55 | QString S; | 61 | QString S; |
56 | return S.sprintf( "bnep%ld", nr ); | 62 | return S.sprintf( "bnep%ld", nr ); |
57 | } | 63 | } |
58 | 64 | ||
59 | 65 | ||
60 | void BluetoothBNEPNetNode::setSpecificAttribute( QString & A, QString & V ) { | 66 | void BluetoothBNEPNetNode::setSpecificAttribute( QString & A, QString & V ) { |
61 | if( A == "interfacecount" ) { | 67 | if( A == "interfacecount" ) { |
62 | InstanceCount = V.toLong(); | 68 | InstanceCount = V.toLong(); |
63 | } | 69 | } |
64 | } | 70 | } |
65 | 71 | ||
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 | } |