00001 #include "bluetooth_NN.h" 00002 #include "bluetoothBNEP_NNI.h" 00003 #include "bluetoothRFCOMM_NNI.h" 00004 00005 // 00006 // 00007 // BLUETOOTH PAN/NAP node 00008 // 00009 // 00010 00011 static const char * BluetoothBNEPNeeds[] = 00012 { 0 00013 }; 00014 00015 static const char * BluetoothBNEPProvides[] = 00016 { "device", 00017 0 00018 }; 00019 00023 BluetoothBNEPNetNode::BluetoothBNEPNetNode() : 00024 ANetNode(tr("Bluetooth PAN/NAP")) { 00025 InstanceCount = 7; // default 00026 } 00027 00031 BluetoothBNEPNetNode::~BluetoothBNEPNetNode(){ 00032 } 00033 00034 const QString BluetoothBNEPNetNode::nodeDescription(){ 00035 return tr("\ 00036 <p>Sets up a bluetooth link using the bluetooth Network profile.</p>\ 00037 <p>Use this to connect two computing devices.</p>\ 00038 " 00039 ); 00040 } 00041 00042 ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) { 00043 return new ABluetoothBNEP( this ); 00044 } 00045 00046 const char ** BluetoothBNEPNetNode::needs( void ) { 00047 return BluetoothBNEPNeeds; 00048 } 00049 00050 const char ** BluetoothBNEPNetNode::provides( void ) { 00051 return BluetoothBNEPProvides; 00052 } 00053 00054 QString BluetoothBNEPNetNode::genNic( long nr ) { 00055 QString S; 00056 return S.sprintf( "bnep%ld", nr ); 00057 } 00058 00059 00060 void BluetoothBNEPNetNode::setSpecificAttribute( QString & A, QString & V ) { 00061 if( A == "interfacecount" ) { 00062 InstanceCount = V.toLong(); 00063 } 00064 } 00065 00066 void BluetoothBNEPNetNode::saveSpecificAttribute( QTextStream & TS) { 00067 TS << "interfacecount=" 00068 << InstanceCount 00069 << endl; 00070 } 00071 00072 // 00073 // 00074 // BLUETOOTH RFCOMM 00075 // 00076 // 00077 00078 static const char * BluetoothRFCOMMNeeds[] = 00079 { 0 00080 }; 00081 00082 BluetoothRFCOMMNetNode::BluetoothRFCOMMNetNode() : 00083 ANetNode( tr("Bluetooth serial link") ) { 00084 } 00085 00086 BluetoothRFCOMMNetNode::~BluetoothRFCOMMNetNode(){ 00087 } 00088 00089 const QString BluetoothRFCOMMNetNode::nodeDescription(){ 00090 return tr("\ 00091 <p>Sets up a bluetooth link using the bluetooth serial profile.</p>\ 00092 <p>Use this to connect to a GSM.</p>\ 00093 " 00094 ); 00095 } 00096 00097 ANetNodeInstance * BluetoothRFCOMMNetNode::createInstance( void ) { 00098 return new ABluetoothRFCOMM( this ); 00099 } 00100 00101 const char ** BluetoothRFCOMMNetNode::needs( void ) { 00102 return BluetoothRFCOMMNeeds; 00103 } 00104 00105 const char * BluetoothRFCOMMNetNode::provides( void ) { 00106 return "line"; 00107 } 00108 00109 void BluetoothRFCOMMNetNode::setSpecificAttribute( QString &, QString & ) { 00110 } 00111 00112 void BluetoothRFCOMMNetNode::saveSpecificAttribute( QTextStream & ) { 00113 } 00114 00115 extern "C" { 00116 void create_plugin( QList<ANetNode> & PNN ) { 00117 PNN.append( new BluetoothBNEPNetNode() ); 00118 PNN.append( new BluetoothRFCOMMNetNode() ); 00119 } 00120 }
1.4.2