Diffstat (limited to 'noncore/settings/networksettings2/bluetooth') (more/less context) (show whitespace changes)
5 files changed, 24 insertions, 27 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h index a21f574..bb3e7e7 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h | |||
@@ -18,24 +18,27 @@ public : | |||
18 | QString acceptable( void ); | 18 | QString acceptable( void ); |
19 | void commit( void ); | 19 | void commit( void ); |
20 | 20 | ||
21 | RuntimeInfo * runtime( void ) | 21 | RuntimeInfo * runtime( void ) |
22 | { if( RT == 0 ) | 22 | { if( RT == 0 ) |
23 | RT = new BluetoothBNEPRun( this, Data ); | 23 | RT = new BluetoothBNEPRun( this, Data ); |
24 | return RT; | 24 | return RT; |
25 | } | 25 | } |
26 | 26 | ||
27 | virtual void * data( void ) | 27 | virtual void * data( void ) |
28 | { return (void *)&Data; } | 28 | { return (void *)&Data; } |
29 | 29 | ||
30 | virtual bool hasDataFor( const QString & S ); | ||
31 | virtual bool generateDataForCommonFile( SystemFile & SF, long ); | ||
32 | |||
30 | protected : | 33 | protected : |
31 | 34 | ||
32 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 35 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
33 | virtual void saveSpecificAttribute( QTextStream & TS ); | 36 | virtual void saveSpecificAttribute( QTextStream & TS ); |
34 | 37 | ||
35 | private : | 38 | private : |
36 | 39 | ||
37 | BluetoothBNEPEdit * GUI; | 40 | BluetoothBNEPEdit * GUI; |
38 | BluetoothBNEPData Data; | 41 | BluetoothBNEPData Data; |
39 | BluetoothBNEPRun * RT; | 42 | BluetoothBNEPRun * RT; |
40 | 43 | ||
41 | }; | 44 | }; |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h index 347da0c..4a773cd 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h | |||
@@ -1,28 +1,23 @@ | |||
1 | #include <asdevice.h> | 1 | #include <asdevice.h> |
2 | #include "bluetoothBNEPdata.h" | 2 | #include "bluetoothBNEPdata.h" |
3 | 3 | ||
4 | class BluetoothBNEPRun : public AsDevice { | 4 | class BluetoothBNEPRun : public AsDevice { |
5 | 5 | ||
6 | public : | 6 | public : |
7 | 7 | ||
8 | BluetoothBNEPRun( ANetNodeInstance * NNI, | 8 | BluetoothBNEPRun( ANetNodeInstance * NNI, |
9 | BluetoothBNEPData & Data ) : AsDevice( NNI ) | 9 | BluetoothBNEPData & Data ) : AsDevice( NNI ) |
10 | { } | 10 | { } |
11 | 11 | ||
12 | virtual long count( void ) | ||
13 | { return 3; } | ||
14 | virtual QString genNic( long nr ) | ||
15 | { QString S; return S.sprintf( "bnep%ld", nr ); } | ||
16 | |||
17 | virtual AsDevice * asDevice( void ) | 12 | virtual AsDevice * asDevice( void ) |
18 | { return (AsDevice *)this; } | 13 | { return (AsDevice *)this; } |
19 | 14 | ||
20 | virtual AsDevice * device( void ) | 15 | virtual AsDevice * device( void ) |
21 | { return asDevice(); } | 16 | { return asDevice(); } |
22 | 17 | ||
23 | protected : | 18 | protected : |
24 | 19 | ||
25 | void detectState( NodeCollection * ) | 20 | void detectState( NodeCollection * ) |
26 | { } | 21 | { } |
27 | 22 | ||
28 | bool setState( NodeCollection * , Action_t ) | 23 | bool setState( NodeCollection * , Action_t ) |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h index 57ff95e..97bd29c 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h | |||
@@ -18,24 +18,27 @@ public : | |||
18 | QString acceptable( void ); | 18 | QString acceptable( void ); |
19 | void commit( void ); | 19 | void commit( void ); |
20 | 20 | ||
21 | RuntimeInfo * runtime( void ) | 21 | RuntimeInfo * runtime( void ) |
22 | { if( RT == 0 ) | 22 | { if( RT == 0 ) |
23 | RT = new BluetoothRFCOMMRun( this, Data ); | 23 | RT = new BluetoothRFCOMMRun( this, Data ); |
24 | return RT; | 24 | return RT; |
25 | } | 25 | } |
26 | 26 | ||
27 | virtual void * data( void ) | 27 | virtual void * data( void ) |
28 | { return (void *)&Data; } | 28 | { return (void *)&Data; } |
29 | 29 | ||
30 | virtual bool hasDataFor( const QString & S ); | ||
31 | virtual bool generateDataForCommonFile( SystemFile & SF, long ); | ||
32 | |||
30 | protected : | 33 | protected : |
31 | 34 | ||
32 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 35 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
33 | virtual void saveSpecificAttribute( QTextStream & TS ); | 36 | virtual void saveSpecificAttribute( QTextStream & TS ); |
34 | 37 | ||
35 | private : | 38 | private : |
36 | 39 | ||
37 | BluetoothRFCOMMEdit * GUI; | 40 | BluetoothRFCOMMEdit * GUI; |
38 | BluetoothRFCOMMData Data; | 41 | BluetoothRFCOMMData Data; |
39 | BluetoothRFCOMMRun * RT; | 42 | BluetoothRFCOMMRun * RT; |
40 | }; | 43 | }; |
41 | 44 | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp index 47272c4..3d1aa69 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp +++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp | |||
@@ -40,40 +40,37 @@ const char ** BluetoothBNEPNetNode::needs( void ) { | |||
40 | return BluetoothBNEPNeeds; | 40 | return BluetoothBNEPNeeds; |
41 | } | 41 | } |
42 | 42 | ||
43 | const char * BluetoothBNEPNetNode::provides( void ) { | 43 | const char * BluetoothBNEPNetNode::provides( void ) { |
44 | return "device"; | 44 | return "device"; |
45 | } | 45 | } |
46 | 46 | ||
47 | bool BluetoothBNEPNetNode::generateProperFilesFor( | 47 | bool BluetoothBNEPNetNode::generateProperFilesFor( |
48 | ANetNodeInstance * ) { | 48 | ANetNodeInstance * ) { |
49 | return 1; | 49 | return 1; |
50 | } | 50 | } |
51 | 51 | ||
52 | bool BluetoothBNEPNetNode::hasDataFor( const QString & S, bool DS ) { | 52 | bool BluetoothBNEPNetNode::hasDataFor( const QString & S ) { |
53 | return DS && S == "interfaces"; | 53 | return S == "interfaces"; |
54 | } | 54 | } |
55 | 55 | ||
56 | bool BluetoothBNEPNetNode::generateDataForCommonFile( | 56 | bool BluetoothBNEPNetNode::generateDeviceDataForCommonFile( |
57 | SystemFile & , | 57 | SystemFile & , |
58 | long , | 58 | long ) { |
59 | ANetNodeInstance * ) { | ||
60 | return 1; | 59 | return 1; |
61 | } | 60 | } |
62 | 61 | ||
63 | bool BluetoothBNEPNetNode::generateDeviceDataForCommonFile( | 62 | QString BluetoothBNEPNetNode::genNic( long nr ) { |
64 | SystemFile & , | 63 | QString S; |
65 | long , | 64 | return S.sprintf( "bnep%ld", nr ); |
66 | ANetNodeInstance * ) { | ||
67 | return 1; | ||
68 | } | 65 | } |
69 | 66 | ||
70 | // | 67 | // |
71 | // | 68 | // |
72 | // BLUETOOTH PAN/NAP node | 69 | // BLUETOOTH PAN/NAP node |
73 | // | 70 | // |
74 | // | 71 | // |
75 | 72 | ||
76 | static const char * BluetoothRFCOMMNeeds[] = | 73 | static const char * BluetoothRFCOMMNeeds[] = |
77 | { 0 | 74 | { 0 |
78 | }; | 75 | }; |
79 | 76 | ||
@@ -99,29 +96,28 @@ const char ** BluetoothRFCOMMNetNode::needs( void ) { | |||
99 | return BluetoothRFCOMMNeeds; | 96 | return BluetoothRFCOMMNeeds; |
100 | } | 97 | } |
101 | 98 | ||
102 | const char * BluetoothRFCOMMNetNode::provides( void ) { | 99 | const char * BluetoothRFCOMMNetNode::provides( void ) { |
103 | return "line"; | 100 | return "line"; |
104 | } | 101 | } |
105 | 102 | ||
106 | bool BluetoothRFCOMMNetNode::generateProperFilesFor( | 103 | bool BluetoothRFCOMMNetNode::generateProperFilesFor( |
107 | ANetNodeInstance * ) { | 104 | ANetNodeInstance * ) { |
108 | return 0; | 105 | return 0; |
109 | } | 106 | } |
110 | 107 | ||
111 | bool BluetoothRFCOMMNetNode::hasDataFor( const QString &, bool ) { | 108 | bool BluetoothRFCOMMNetNode::hasDataFor( const QString & ) { |
112 | return 0; | 109 | return 0; |
113 | } | 110 | } |
114 | 111 | ||
115 | bool BluetoothRFCOMMNetNode::generateDataForCommonFile( | 112 | bool BluetoothRFCOMMNetNode::generateDeviceDataForCommonFile( |
116 | SystemFile & , | 113 | SystemFile & , |
117 | long, | 114 | long ) { |
118 | ANetNodeInstance * ) { | ||
119 | return 0; | 115 | return 0; |
120 | } | 116 | } |
121 | 117 | ||
122 | extern "C" { | 118 | extern "C" { |
123 | void create_plugin( QList<ANetNode> & PNN ) { | 119 | void create_plugin( QList<ANetNode> & PNN ) { |
124 | PNN.append( new BluetoothBNEPNetNode() ); | 120 | PNN.append( new BluetoothBNEPNetNode() ); |
125 | PNN.append( new BluetoothRFCOMMNetNode() ); | 121 | PNN.append( new BluetoothRFCOMMNetNode() ); |
126 | } | 122 | } |
127 | } | 123 | } |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h index d72b0d4..5cd6c52 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h +++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h | |||
@@ -19,29 +19,31 @@ public: | |||
19 | 19 | ||
20 | virtual const QString nodeName() | 20 | virtual const QString nodeName() |
21 | { return tr("Bluetooth PAN/NAP"); } | 21 | { return tr("Bluetooth PAN/NAP"); } |
22 | 22 | ||
23 | virtual const QString nodeDescription() ; | 23 | virtual const QString nodeDescription() ; |
24 | 24 | ||
25 | virtual ANetNodeInstance * createInstance( void ); | 25 | virtual ANetNodeInstance * createInstance( void ); |
26 | 26 | ||
27 | virtual const char ** needs( void ); | 27 | virtual const char ** needs( void ); |
28 | virtual const char * provides( void ); | 28 | virtual const char * provides( void ); |
29 | 29 | ||
30 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); | 30 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); |
31 | virtual bool hasDataFor( const QString & S, bool DS ); | 31 | virtual bool hasDataFor( const QString & S ); |
32 | virtual bool generateDataForCommonFile( | ||
33 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | ||
34 | virtual bool generateDeviceDataForCommonFile( | 32 | virtual bool generateDeviceDataForCommonFile( |
35 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | 33 | SystemFile & , long DevNr ); |
34 | |||
35 | virtual long instanceCount( void ) | ||
36 | { return 7; } | ||
37 | virtual QString genNic( long ); | ||
36 | 38 | ||
37 | private: | 39 | private: |
38 | 40 | ||
39 | }; | 41 | }; |
40 | 42 | ||
41 | class BluetoothRFCOMMNetNode : public ANetNode { | 43 | class BluetoothRFCOMMNetNode : public ANetNode { |
42 | 44 | ||
43 | Q_OBJECT | 45 | Q_OBJECT |
44 | 46 | ||
45 | public: | 47 | public: |
46 | 48 | ||
47 | BluetoothRFCOMMNetNode(); | 49 | BluetoothRFCOMMNetNode(); |
@@ -52,28 +54,26 @@ public: | |||
52 | 54 | ||
53 | virtual const QString nodeName() | 55 | virtual const QString nodeName() |
54 | { return tr("Bluetooth serial link"); } | 56 | { return tr("Bluetooth serial link"); } |
55 | 57 | ||
56 | virtual const QString nodeDescription() ; | 58 | virtual const QString nodeDescription() ; |
57 | 59 | ||
58 | virtual ANetNodeInstance * createInstance( void ); | 60 | virtual ANetNodeInstance * createInstance( void ); |
59 | 61 | ||
60 | virtual const char ** needs( void ); | 62 | virtual const char ** needs( void ); |
61 | virtual const char * provides( void ); | 63 | virtual const char * provides( void ); |
62 | 64 | ||
63 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); | 65 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); |
64 | virtual bool hasDataFor( const QString & S, bool ); | 66 | virtual bool hasDataFor( const QString & S ); |
65 | virtual bool generateDataForCommonFile( | ||
66 | SystemFile & SF, long, ANetNodeInstance * NNI ); | ||
67 | virtual bool generateDeviceDataForCommonFile( | 67 | virtual bool generateDeviceDataForCommonFile( |
68 | SystemFile & SF, long, ANetNodeInstance * NNI ); | 68 | SystemFile & , long ); |
69 | 69 | ||
70 | private: | 70 | private: |
71 | 71 | ||
72 | }; | 72 | }; |
73 | 73 | ||
74 | extern "C" | 74 | extern "C" |
75 | { | 75 | { |
76 | void create_plugin( QList<ANetNode> & PNN ); | 76 | void create_plugin( QList<ANetNode> & PNN ); |
77 | }; | 77 | }; |
78 | 78 | ||
79 | #endif | 79 | #endif |