summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/usb
authorwimpie <wimpie>2004-08-09 02:31:25 (UTC)
committer wimpie <wimpie>2004-08-09 02:31:25 (UTC)
commit0784cfdbd261c43856b45be6ab7439841e69b858 (patch) (unidiff)
treef6a27d6b2e1e6d8dcc908b2ef5836cd320ddfab1 /noncore/settings/networksettings2/usb
parent5e10278e748608766245ff9f59a54d1ae8ff6f7e (diff)
downloadopie-0784cfdbd261c43856b45be6ab7439841e69b858.zip
opie-0784cfdbd261c43856b45be6ab7439841e69b858.tar.gz
opie-0784cfdbd261c43856b45be6ab7439841e69b858.tar.bz2
Many changes :
bluetooth and usb seems to work added preliminary support for VPN on top of any network This version is still very much crippled yet is does DO some things
Diffstat (limited to 'noncore/settings/networksettings2/usb') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/usb/usbrun.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/noncore/settings/networksettings2/usb/usbrun.cpp b/noncore/settings/networksettings2/usb/usbrun.cpp
index beacd7b..b8ac8a8 100644
--- a/noncore/settings/networksettings2/usb/usbrun.cpp
+++ b/noncore/settings/networksettings2/usb/usbrun.cpp
@@ -12,12 +12,14 @@ void USBRun::detectState( NodeCollection * NC ) {
12 System & Sys = NSResources->system(); 12 System & Sys = NSResources->system();
13 InterfaceInfo * Run; 13 InterfaceInfo * Run;
14 QFile F( S ); 14 QFile F( S );
15 Log(("Detecting for %s\n", NC->name().latin1() ));
15 16
16 if( F.open( IO_ReadOnly ) ) { 17 if( F.open( IO_ReadOnly ) ) {
17 // could open file -> read interface and assign 18 // could open file -> read interface and assign
18 QString X; 19 QString X;
19 QTextStream TS(&F); 20 QTextStream TS(&F);
20 X = TS.readLine(); 21 X = TS.readLine();
22 Log(("%s exists\n", S.latin1() ));
21 // find interface 23 // find interface
22 if( handlesInterface( X ) ) { 24 if( handlesInterface( X ) ) {
23 for( QDictIterator<InterfaceInfo> It(Sys.interfaces()); 25 for( QDictIterator<InterfaceInfo> It(Sys.interfaces());
@@ -34,7 +36,7 @@ void USBRun::detectState( NodeCollection * NC ) {
34 } 36 }
35 } 37 }
36 38
37 fprintf( stderr, "Assigned %p\n", assignedInterface() ); 39 Log(("Assigned %p\n", assignedInterface() ));
38 if( ( Run = assignedInterface() ) ) { 40 if( ( Run = assignedInterface() ) ) {
39 // we already have an interface assigned -> still present ? 41 // we already have an interface assigned -> still present ?
40 if( ! Run->IsUp ) { 42 if( ! Run->IsUp ) {
@@ -53,24 +55,24 @@ void USBRun::detectState( NodeCollection * NC ) {
53 ++It ) { 55 ++It ) {
54 Run = It.current(); 56 Run = It.current();
55 57
56 fprintf( stderr, "%s %d %d=%d %d\n", 58 Log(("%s %d %d=%d %d\n",
57 Run->Name.latin1(), 59 Run->Name.latin1(),
58 handlesInterface( Run->Name ), 60 handlesInterface( Run->Name ),
59 Run->CardType, ARPHRD_ETHER, 61 Run->CardType, ARPHRD_ETHER,
60 ! Run->IsUp ); 62 ! Run->IsUp ));
61 63
62 if( handlesInterface( Run->Name ) && 64 if( handlesInterface( Run->Name ) &&
63 Run->CardType == ARPHRD_ETHER && 65 Run->CardType == ARPHRD_ETHER &&
64 ! Run->IsUp 66 ! Run->IsUp
65 ) { 67 ) {
66 fprintf( stderr, "Released(OFF)\n" ); 68 Log(("Released(OFF)\n" ));
67 // proper type, and Not UP -> free 69 // proper type, and Not UP -> free
68 NC->setCurrentState( Off ); 70 NC->setCurrentState( Off );
69 return; 71 return;
70 } 72 }
71 } 73 }
72 // no free found 74 // no free found
73 fprintf( stderr, "UNA\n" ); 75 Log(("UNA\n" ));
74 76
75 NC->setCurrentState( Unavailable ); 77 NC->setCurrentState( Unavailable );
76} 78}
@@ -94,7 +96,7 @@ bool USBRun::setState( NodeCollection * NC, Action_t A, bool ) {
94 // we get back is NOT assigned 96 // we get back is NOT assigned
95 N->assignNode( netNode() ); 97 N->assignNode( netNode() );
96 assignInterface( N ); 98 assignInterface( N );
97 fprintf( stderr, "Assing %p\n", N ); 99 Log(("Assing %p\n", N ));
98 NC->setCurrentState( Available ); 100 NC->setCurrentState( Available );
99 return 1; 101 return 1;
100 } 102 }