summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp
blob: 1d0a0f7e107807ee380254062447c60c54d0ac5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#include "bluetooth_NN.h"
#include "bluetoothBNEP_NNI.h"
#include "bluetoothRFCOMM_NNI.h"

//
//
// BLUETOOTH PAN/NAP node
//
//

static const char * BluetoothBNEPNeeds[] = 
    { 0
    };

/**
 * Constructor, find all of the possible interfaces
 */
BluetoothBNEPNetNode::BluetoothBNEPNetNode() : 
      ANetNode(tr("Bluetooth PAN/NAP")) {
      InstanceCount = 7; // default
}

/**
 * Delete any interfaces that we own.
 */
BluetoothBNEPNetNode::~BluetoothBNEPNetNode(){
}

const QString BluetoothBNEPNetNode::nodeDescription(){
      return tr("\
<p>Sets up a bluetooth link using the bluetooth Network profile.</p>\
<p>Use this to connect two computing devices.</p>\
"
);
}

ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) {
      return new ABluetoothBNEP( this );
}

const char ** BluetoothBNEPNetNode::needs( void ) {
      return BluetoothBNEPNeeds;
}

const char * BluetoothBNEPNetNode::provides( void ) {
      return "device";
}

bool BluetoothBNEPNetNode::generateProperFilesFor( 
            ANetNodeInstance * ) {
      return 1;
}

bool BluetoothBNEPNetNode::hasDataFor( const QString & S ) {
      return S == "interfaces";
}

bool BluetoothBNEPNetNode::generateDeviceDataForCommonFile( 
                                SystemFile & , 
                                long ) {
      return 1;
}

QString BluetoothBNEPNetNode::genNic( long nr ) { 
      QString S; 
      return S.sprintf( "bnep%ld", nr );
}


void BluetoothBNEPNetNode::setSpecificAttribute( QString & A, QString & V ) {
      if( A == "interfacecount" ) {
        InstanceCount = V.toLong();
      }
}

void BluetoothBNEPNetNode::saveSpecificAttribute( QTextStream & TS) {
      TS << "interfacecount="
         << InstanceCount
         << endl;
}

//
//
// BLUETOOTH RFCOMM
//
//

static const char * BluetoothRFCOMMNeeds[] = 
    { 0
    };

BluetoothRFCOMMNetNode::BluetoothRFCOMMNetNode() : 
      ANetNode( tr("Bluetooth serial link") ) {
}

BluetoothRFCOMMNetNode::~BluetoothRFCOMMNetNode(){
}

const QString BluetoothRFCOMMNetNode::nodeDescription(){
      return tr("\
<p>Sets up a bluetooth link using the bluetooth serial profile.</p>\
<p>Use this to connect to a GSM.</p>\
"
);
}

ANetNodeInstance * BluetoothRFCOMMNetNode::createInstance( void ) {
      return new ABluetoothRFCOMM( this );
}

const char ** BluetoothRFCOMMNetNode::needs( void ) {
      return BluetoothRFCOMMNeeds;
}

const char * BluetoothRFCOMMNetNode::provides( void ) {
      return "line";
}

bool BluetoothRFCOMMNetNode::generateProperFilesFor( 
            ANetNodeInstance * ) {
      return 0;
}

bool BluetoothRFCOMMNetNode::hasDataFor( const QString &  ) {
      return 0;
}

bool BluetoothRFCOMMNetNode::generateDeviceDataForCommonFile( 
                                SystemFile & , 
                                long ) {
      return 0;
}

void BluetoothRFCOMMNetNode::setSpecificAttribute( QString &, QString & ) {
}

void BluetoothRFCOMMNetNode::saveSpecificAttribute( QTextStream & ) {
}

extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
      PNN.append( new BluetoothBNEPNetNode() );
      PNN.append( new BluetoothRFCOMMNetNode() );
}
}