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 | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp new file mode 100644 index 0000000..ee3e92b --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp | |||
@@ -0,0 +1,78 @@ | |||
1 | #include "bluetoothBNEP_NN.h" | ||
2 | #include "bluetoothBNEP_NNI.h" | ||
3 | #include "bluetoothRFCOMM_NNI.h" | ||
4 | |||
5 | // | ||
6 | // | ||
7 | // BLUETOOTH PAN/NAP node | ||
8 | // | ||
9 | // | ||
10 | |||
11 | static const char * BluetoothBNEPNeeds[] = | ||
12 | { 0 | ||
13 | }; | ||
14 | |||
15 | static const char * BluetoothBNEPProvides[] = | ||
16 | { "device", | ||
17 | 0 | ||
18 | }; | ||
19 | |||
20 | /** | ||
21 | * Constructor, find all of the possible interfaces | ||
22 | */ | ||
23 | BluetoothBNEPNetNode::BluetoothBNEPNetNode() : | ||
24 | ANetNode(tr("Bluetooth PAN/NAP")) { | ||
25 | InstanceCount = 7; // default | ||
26 | } | ||
27 | |||
28 | /** | ||
29 | * Delete any interfaces that we own. | ||
30 | */ | ||
31 | BluetoothBNEPNetNode::~BluetoothBNEPNetNode(){ | ||
32 | } | ||
33 | |||
34 | const QString BluetoothBNEPNetNode::nodeDescription(){ | ||
35 | return tr("\ | ||
36 | <p>Sets up a bluetooth link using the bluetooth Network profile.</p>\ | ||
37 | <p>Use this to connect two computing devices.</p>\ | ||
38 | " | ||
39 | ); | ||
40 | } | ||
41 | |||
42 | ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) { | ||
43 | return new ABluetoothBNEP( this ); | ||
44 | } | ||
45 | |||
46 | const char ** BluetoothBNEPNetNode::needs( void ) { | ||
47 | return BluetoothBNEPNeeds; | ||
48 | } | ||
49 | |||
50 | const char ** BluetoothBNEPNetNode::provides( void ) { | ||
51 | return BluetoothBNEPProvides; | ||
52 | } | ||
53 | |||
54 | QString BluetoothBNEPNetNode::genNic( long nr ) { | ||
55 | QString S; | ||
56 | return S.sprintf( "bnep%ld", nr ); | ||
57 | } | ||
58 | |||
59 | |||
60 | void BluetoothBNEPNetNode::setSpecificAttribute( QString & A, QString & V ) { | ||
61 | if( A == "interfacecount" ) { | ||
62 | InstanceCount = V.toLong(); | ||
63 | } | ||
64 | } | ||
65 | |||
66 | void BluetoothBNEPNetNode::saveSpecificAttribute( QTextStream & TS) { | ||
67 | TS << "interfacecount=" | ||
68 | << InstanceCount | ||
69 | << endl; | ||
70 | } | ||
71 | |||
72 | extern "C" { | ||
73 | // create plugin registers both BT functions | ||
74 | void create_plugin( QList<ANetNode> & PNN ) { | ||
75 | PNN.append( new BluetoothBNEPNetNode() ); | ||
76 | PNN.append( new BluetoothRFCOMMNetNode() ); | ||
77 | } | ||
78 | } | ||