You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(8) |
Apr
(82) |
May
(26) |
Jun
(181) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: Christopher B. <ba...@cm...> - 2006-07-14 19:02:06
|
If SourceForge stuff doesn't work for you (e.g. CVS, TeRK's sf site, etc),
trying changing your SourgeForge password. That fixed it for me. Here are details:
https://sourceforge.net/forum/forum.php?forum_id=591370
chris
|
|
From: Michael S. <ms...@us...> - 2006-06-19 17:48:21
|
Update of /cvsroot/terk/embed/src/libqwerk In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29526/src/libqwerk Modified Files: qemotorrec.h Log Message: Mike: can record on all motors Index: qemotorrec.h =================================================================== RCS file: /cvsroot/terk/embed/src/libqwerk/qemotorrec.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** qemotorrec.h 5 Apr 2006 18:52:33 -0000 1.1 --- qemotorrec.h 19 Jun 2006 17:48:15 -0000 1.2 *************** *** 27,30 **** --- 27,31 ---- bool Recording(); bool UpdatePosition(); // returns true if RecordUpdate needs updated position + short* GetData(){ return m_pdata; } protected: |
|
From: Michael S. <ms...@us...> - 2006-06-19 17:48:20
|
Update of /cvsroot/terk/embed/src/terkapi In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29526/src/terkapi Modified Files: MotorControllerI.cpp Log Message: Mike: can record on all motors Index: MotorControllerI.cpp =================================================================== RCS file: /cvsroot/terk/embed/src/terkapi/MotorControllerI.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MotorControllerI.cpp 13 Jun 2006 20:44:06 -0000 1.3 --- MotorControllerI.cpp 19 Jun 2006 17:48:15 -0000 1.4 *************** *** 72,75 **** --- 72,76 ---- void MotorControllerI::startMotorBufferRecord(const BooleanArray& motorMask, const Ice::Current&) { + motors->Record(); } *************** *** 77,81 **** { int i; ! for (i = 0; i < QEMOT_NUM_MOTORS; i++) buffers[i].values.resize(0); --- 78,82 ---- { int i; ! motors->RStop(); for (i = 0; i < QEMOT_NUM_MOTORS; i++) buffers[i].values.resize(0); *************** *** 105,108 **** --- 106,110 ---- void MotorControllerI::playMotorBuffer(const BooleanArray& motorMask, const Ice::Current&) { + motors->Play(); } |
|
From: Ivan D. <idr...@us...> - 2006-06-15 00:44:33
|
Update of /cvsroot/terk/embed/www In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15501/www Modified Files: menu.html Log Message: cosmetic changes Index: menu.html =================================================================== RCS file: /cvsroot/terk/embed/www/menu.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** menu.html 6 Jun 2006 18:34:47 -0000 1.1 --- menu.html 15 Jun 2006 00:44:29 -0000 1.2 *************** *** 11,18 **** <hr size="1" /> ! <li><a href="../cgi-bin/status.cgi" target="mainFrame">Status</a></li> ! <li><a href="../cgi-bin/wifi.cgi" target="mainFrame">Wireless Configuration</a></li> ! <li><a href="../cgi-bin/wired.cgi" target="mainFrame">Wired Configuration</a></li> ! <li><a href="loglinks.html" target="mainFrame">Startup logs</a></li> <hr /> --- 11,18 ---- <hr size="1" /> ! <li><a href="../cgi-bin/status.cgi" target="mainFrame"> Status </a></li> ! <li><a href="../cgi-bin/wifi.cgi" target="mainFrame"> Wireless Configuration </a></li> ! <li><a href="../cgi-bin/wired.cgi" target="mainFrame"> Wired Configuration </a></li> ! <li><a href="loglinks.html" target="mainFrame"> Startup logs </a></li> <hr /> |
|
From: Ivan D. <idr...@us...> - 2006-06-15 00:42:23
|
Update of /cvsroot/terk/embed/www/cgi-bin In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14554/www/cgi-bin Modified Files: wifiSave.cgi Log Message: cosmetic changes Index: wifiSave.cgi =================================================================== RCS file: /cvsroot/terk/embed/www/cgi-bin/wifiSave.cgi,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wifiSave.cgi 14 Jun 2006 01:23:24 -0000 1.2 --- wifiSave.cgi 15 Jun 2006 00:42:20 -0000 1.3 *************** *** 26,33 **** if($data{isSSIDAuto} eq 'true'){ print CONFIG "auto=true\n"; ! print LOG "auto=true\n"; } else { print CONFIG "auto=false\n"; ! print LOG "auto=false\n"; } --- 26,33 ---- if($data{isSSIDAuto} eq 'true'){ print CONFIG "auto=true\n"; ! print LOG "\tauto=true\n"; } else { print CONFIG "auto=false\n"; ! print LOG "\tauto=false\n"; } |
|
From: Ivan D. <idr...@us...> - 2006-06-15 00:41:06
|
Update of /cvsroot/terk/embed/src/scripts In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13687/src/scripts Modified Files: autoconnect.pl robot.init config.wlan0.default wifiConnect.pl Log Message: Redesigned network connection procedure. Includes reading config files, WEP, and more reliable pinging. Removed calls to getIP. Index: config.wlan0.default =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/config.wlan0.default,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.wlan0.default 24 Apr 2006 19:00:55 -0000 1.1 --- config.wlan0.default 15 Jun 2006 00:40:58 -0000 1.2 *************** *** 1,4 **** ! auto=true ! dataEncryption=false ! ssid=CMU ! networkKey= --- 1,4 ---- ! auto=true ! dataEncryption=false ! ssid=CMU ! networkKey= Index: robot.init =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/robot.init,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** robot.init 13 Jun 2006 20:44:06 -0000 1.21 --- robot.init 15 Jun 2006 00:40:58 -0000 1.22 *************** *** 10,13 **** --- 10,14 ---- mv /opt/connectlog0.txt /opt/connectlog1.txt + echo `date +%R:%S` Robot.init started. >> /opt/connectlog0.txt echo `date +%R:%S` Copied logs. >> /opt/connectlog0.txt *************** *** 19,22 **** --- 20,25 ---- insmod /opt/drivers/qemotor.ko >> /opt/connectlog0.txt + mount -t nfs -o nolock 192.168.1.103:/edbnfs /mnt >> /opt/connect.log #Mount edbnfs folder + #################### Stage 0.1: Generate Unique mubers, checking for CFG ########################### *************** *** 60,77 **** ln -s /opt/connectlog4.txt /home/www/connectlog4.txt ! #################### Stage 1 & 2: Network Connect##################################################### /opt/bin/setLEDs ! /opt/scripts/wifiConnect.pl wlan0 >> /opt/connect.log ! /opt/scripts/wiredConnect.pl eth0 >> /opt/connect.log ! udhcpc -i wlan0 -b -p /var/run/udhcpc.wlan0 >/dev/null 2>&1 >> /opt/connect.log ! mount -t nfs -o nolock 192.168.1.103:/edbnfs /mnt >> /opt/connect.log ! sleep 5; ! /opt/scripts/waitForPing.pl 128.2.211.159 >> /opt/connect.log cd /opt/ice --- 63,80 ---- ln -s /opt/connectlog4.txt /home/www/connectlog4.txt ! #################### Stage 1 & 2: Network Connect #################################################### /opt/bin/setLEDs ! echo `date +%R:%S` Connecting to the network... >> /opt/connectlog0.txt ! /opt/scripts/wiredConnect.pl eth0 ! /opt/scripts/wifiConnect.pl wlan0 ! udhcpc -i wlan0 -b -p /var/run/udhcpc.wlan0 >/dev/null 2>&1 ! /opt/scripts/tryGateways.pl ! ################### Stage X: Start Terk Server ####################################################### cd /opt/ice Index: wifiConnect.pl =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/wifiConnect.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wifiConnect.pl 13 Jun 2006 20:44:06 -0000 1.7 --- wifiConnect.pl 15 Jun 2006 00:40:58 -0000 1.8 *************** *** 34,45 **** } ! $ssid = $Config{"ssid"}; ! $networkKey = $Config{"networkKey"}; open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_ifstate ifstate=enable |"); open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=p2CnfShortPreamble=long |"); - if ($Config{"auto"} =~ m/true/){ print LOG "\tUsing autoconnect\n"; open(SCAN, "/opt/scripts/scan.pl |") or die "Cannot run scan.pl $!\n"; --- 34,66 ---- } ! ###################### print config settings ########################### ! ! print LOG "\tLoading config settings...\n"; ! print LOG "\t--------------------------\n"; ! ! $auto = $Config{"auto"}; ! $ssid = $Config{"ssid"}; ! $dataEncryption = $Config{"dataEncryption"}; ! $networkKey = $Config{"networkKey"}; ! ! if($auto eq 'true'){ ! print LOG "\tauto=true\n"; ! } else { ! print LOG "\tauto=false\n"; ! } ! ! print LOG "\tssid = $ssid\n"; ! print LOG "\tdataEncryption = $dataEncryption\n"; ! print LOG "\tnetworkKey = $networkKey\n"; ! ! ################### start connecting #################################### open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_ifstate ifstate=enable |"); open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=p2CnfShortPreamble=long |"); + if ($auto =~ m/true/) + { + ##################### autoconnect ########################### print LOG "\tUsing autoconnect\n"; open(SCAN, "/opt/scripts/scan.pl |") or die "Cannot run scan.pl $!\n"; *************** *** 50,72 **** print LOG "\t$_ \n"; } ! } else { ! if($Config{"dataEncryption"} =~ m/wep/){ ! print LOG "\tConnecting using encryption to $ssid\n"; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=dot11WEPDefaultKey=$networkKey |"); ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=dot11WEPDefaultKeyID=0 |"); ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=dot11ExcludeUnencrypted=true |"); ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_autojoin ssid=$ssid authtype=opensystem |"); ! ! } else { ! print LOG "\tConnecting unencrypted to $ssid\n"; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_autojoin ssid=$ssid authtype=opensystem |"); } ! # open(SETLEDS, "/opt/bin/setLEDs 0 1 2 3 4 5|"); ! # sleep 1; ! # open(SETLEDS, "/opt/bin/setLEDs 0|"); ! # sleep 1; ! # open(SETLEDS, "/opt/bin/setLEDs 0 1 2 3 4 5|"); } --- 71,143 ---- print LOG "\t$_ \n"; } + } + else + { + if ($dataEncryption eq "Disabled") + { + ############### connect to a specific SSID, no WEP ########## ! print LOG "\tConnecting unencrypted to $ssid\n"; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_autojoin ssid=$ssid authtype=opensystem |"); } + else + { + ############## connect to a specific SSID, using WEP ####### ! print LOG "\tConnecting using $networkKey to $ssid\n"; ! ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_autojoin ssid=$ssid authtype=opensystem |"); ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_hostwep encrypt=true decrypt=true |"); ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=dot11PrivacyInvoked=true |"); ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=dot11WEPDefaultKeyID=0 |"); ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=dot11WEPDefaultKey0=$networkKey |"); ! } ! ! ################## ping to verify ############################## ! ! $pkts_sent = 0; ! $pkts_rcvd = 0; ! $max = 0; ! ! open (PING, "/bin/ping -c 4 128.2.211.159 |"); ! ! while (<PING>) { ! if (/^(\d+) packets transmitted, (\d+) /) { ! $pkts_sent = $1; ! $pkts_rcvd = $2; ! } ! elsif (/(\d+\.?\d*)\/(\d+\.?\d*)\/(\d+\.?\d*)/) { #look for num/num/num ! $min = $1; ! $avg = $2; ! $max = $3; ! } ! elsif (/^(\d+).*seq=(\d+).*ttl=(\d+).*time=(\d+\.?\d*) ms/) { ! # look for packet size seq=NN and time=NN ! $pkt_size[$pingI]=$1; ! $seq[$pingI]=$2; ! $ttl[$pingI]=$3; ! $rtt[$pingI]=$4; ! $pingI++; ! } ! elsif (/^(\d+).*seq=(\d+).*ttl=(\d+).*time=(\d+\.?\d*) usec/) { ! # look for packet size seq=NN and time=NN ! $pkt_size[$pingI]=$1; ! $seq[$pingI]=$2; ! $ttl[$pingI]=$3; ! $rtt[$pingI]=$4/1000; ! $pingI++; ! } ! elsif( /^interval: (\d+\.?\d*)/ ) { ! $interval = $1; ! } ! } ! ! close (PING); ! ! if($pkts_rcvd == 0){ ! print LOG "\tSuccessfully connected!\n"; ! } else { ! print LOG "\tPing test failed. Not connected\n"; ! } } Index: autoconnect.pl =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/autoconnect.pl,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** autoconnect.pl 13 Jun 2006 20:44:06 -0000 1.12 --- autoconnect.pl 15 Jun 2006 00:40:58 -0000 1.13 *************** *** 19,37 **** if($_ =~ m/\berror\b/) { print LOG "\tNo wlan0!\n"; ! print LOG "\t$_\n"; ! #open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5 6 7 |") or die "Cannot set LED $!\n"; ! #sleep 1; ! #open(LED, "/opt/bin/setLEDs |") or die "Cannot set LED $!\n"; ! #sleep 1; ! #open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5 6 7 |") or die "Cannot set LED $!\n"; ! #sleep 1; ! #open(LED, "/opt/bin/setLEDs |") or die "Cannot set LED $!\n"; close(LOG); exit; } } - - #open(LED, "/opt/bin/setLEDs 0 |") or die "Cannot set LED $!\n"; print LOG "\tTrying the various access points:\n"; --- 19,30 ---- if($_ =~ m/\berror\b/) { print LOG "\tNo wlan0!\n"; ! print LOG "\t$_\n"; close(LOG); exit; } } + ############################# load results ################################# + print LOG "\tTrying the various access points:\n"; *************** *** 57,69 **** $connect_success = 0; ! ! print LOG "\tbssid: $bssid ssid: $ssid\n"; ! ! if($ssid eq "no_value"){ ! } else { ! #open(LED, "/opt/bin/setLEDs|") or die "Cannot set LED $!\n"; ! #sleep .2; ! #open(LED, "/opt/bin/setLEDs 0|") or die "Cannot set LED $!\n"; open (CONNECT, "/sbin/wlanctl-ng wlan0 lnxreq_autojoin ssid=$ssid authtype=opensystem |") or die "Cannot open connect $!\n"; --- 50,66 ---- $connect_success = 0; ! ! if($ssid eq "no_value" || $ssid eq ""){ ! $Results[$index]{ping_success} = "bad"; ! } ! else { + ############################ connect ################################## + + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); + + printf LOG "\t%02d:%02d:%02d ", $hour, $min, $sec; + print LOG "trying network: $ssid\n"; + open (CONNECT, "/sbin/wlanctl-ng wlan0 lnxreq_autojoin ssid=$ssid authtype=opensystem |") or die "Cannot open connect $!\n"; *************** *** 76,122 **** my ($var, $value) = split(/\s*=\s*/, $_, 2); $value =~ tr/'//d; ! $CONNECT_Result{$var} = $value; ! # print LOG "\tvar $var is $value\n"; } close CONNECT; ! open(PSAUX, "/bin/ps |") or die "Cannot run /bin/ps $!\n"; ! while(<PSAUX>) { ! if($_ =~ /wlan0/ && $_ =~ /udhcpc/){ ! chomp; ! @entry = split(' '); ! $pid = $entry[0]; ! print LOG "\tkilling udhcpc pid $pid\n"; ! open (KILLUDHCPC, "/bin/kill $pid |") or die "Cannot kill udhcpc $!\n"; ! } ! } ! ! sleep 1; open (RENEW, "/sbin/udhcpc -nq -i wlan0|") or die "Cannot send renew signal to udhcpc $!\n"; ! # open (RENEW, "/bin/kill -SIGUSR1 $pid |") or die "Cannot send renew signal to udhcpc $!\n"; ! sleep 1; ! open(IPGRAB, "/opt/scripts/getIP.pl wlan0 |"); ! while(<IPGRAB>){ ! chomp; ! $ip = $_; ! } ! $pkts_sent = 0; ! $pkts_rcvd = 0; ! $max = 0; ! if($ip){ ! print LOG "\tGot: $ip \n"; ! open (PING, "/bin/ping -c 4 128.2.211.159 |"); while (<PING>) { - # print "$_"; if (/^(\d+) packets transmitted, (\d+) /) { ! $pkts_sent = $1; ! $pkts_rcvd = $2; } elsif (/(\d+\.?\d*)\/(\d+\.?\d*)\/(\d+\.?\d*)/) { #look for num/num/num --- 73,115 ---- my ($var, $value) = split(/\s*=\s*/, $_, 2); $value =~ tr/'//d; ! $CONNECT_Result{$var} = $value; ! # print LOG "\t\tvar $var is $value\n"; } close CONNECT; ! #open(PSAUX, "/bin/ps |") or die "Cannot run /bin/ps $!\n"; ! #while(<PSAUX>) { ! # if($_ =~ /wlan0/ && $_ =~ /udhcpc/){ ! # chomp; ! # @entry = split(' '); ! # $pid = $entry[0]; ! # print LOG "\t\tkilling udhcpc pid $pid\n"; ! # open (KILLUDHCPC, "/bin/kill $pid |") or die "Cannot kill udhcpc $!\n"; ! # } ! #} ! #sleep 1; open (RENEW, "/sbin/udhcpc -nq -i wlan0|") or die "Cannot send renew signal to udhcpc $!\n"; ! #sleep 1; ! #open(IPGRAB, "/opt/scripts/getIP.pl wlan0 |"); ! #while(<IPGRAB>){ ! # chomp; ! # $ip = $_; ! #} ! ############################### ping ############################################## ! $pkts_sent = 0; ! $pkts_rcvd = 0; ! $max = 0; ! open (PING, "/bin/ping -c 3 128.2.211.159 |"); while (<PING>) { if (/^(\d+) packets transmitted, (\d+) /) { ! $pkts_sent = $1; ! $pkts_rcvd = $2; } elsif (/(\d+\.?\d*)\/(\d+\.?\d*)\/(\d+\.?\d*)/) { #look for num/num/num *************** *** 132,136 **** $rtt[$pingI]=$4; $pingI++; ! } elsif (/^(\d+).*seq=(\d+).*ttl=(\d+).*time=(\d+\.?\d*) usec/) { # look for packet size seq=NN and time=NN $pkt_size[$pingI]=$1; --- 125,130 ---- $rtt[$pingI]=$4; $pingI++; ! } ! elsif (/^(\d+).*seq=(\d+).*ttl=(\d+).*time=(\d+\.?\d*) usec/) { # look for packet size seq=NN and time=NN $pkt_size[$pingI]=$1; *************** *** 144,152 **** } } close (PING); ! print LOG "\tpackets sent: $pkts_sent packets received: $pkts_rcvd\n"; ! print LOG "\tmax response time was: $max\n"; ! } if($pkts_rcvd == 0){ --- 138,146 ---- } } + close (PING); ! # print LOG "\tpackets sent: $pkts_sent packets received: $pkts_rcvd\n"; ! # print LOG "\tmax response time was: $max\n"; if($pkts_rcvd == 0){ *************** *** 160,163 **** --- 154,159 ---- } + ################################ order by ping results ##################################### + @ordered = sort { $b->{pkts_rcvd} <=> $a->{pkts_rcvd} || $b->{signal} <=> $a->{signal} } @Results; *************** *** 166,170 **** printf LOG "\n\t%02d:%02d:%02d ", $hour, $min, $sec; print LOG "Results in order of preference: \n\n"; ! for $ref (@ordered){ $ossid = $ref->{ssid}; --- 162,168 ---- printf LOG "\n\t%02d:%02d:%02d ", $hour, $min, $sec; print LOG "Results in order of preference: \n\n"; ! print LOG "\tstatus\tpackets\tsignal\tnoise\tSSID\n"; ! print LOG "\t-------------------------------------\n"; ! for $ref (@ordered){ $ossid = $ref->{ssid}; *************** *** 173,185 **** $osignal = $ref->{signal} - 65400; $onoise = $ref->{noise} - 65400; ! print LOG "\t$obssid $opkts_rcvd $osignal $onoise $ossid\n"; } $best_ssid = $ordered[0]{ssid}; if($ordered[0]{ping_success} eq "good"){ - #open(LED, "/opt/bin/setLEDs 0 1 |") or die "Cannot set LED $!\n"; ! print LOG "\tConnecting to ssid: $best_ssid\n"; open (FINAL_CONNECT, "/sbin/wlanctl-ng wlan0 lnxreq_autojoin ssid=$best_ssid authtype=opensystem |") or die "Cannot open connect $!\n"; --- 171,185 ---- $osignal = $ref->{signal} - 65400; $onoise = $ref->{noise} - 65400; ! $oping_success = $ref->{ping_success}; ! print LOG "\t$oping_success\t$opkts_rcvd\t$osignal\t$onoise\t$ossid\n"; } $best_ssid = $ordered[0]{ssid}; + ############################# connect to best ################################################# + if($ordered[0]{ping_success} eq "good"){ ! print LOG "\n\tFound available network! Connecting to ssid: $best_ssid\n"; open (FINAL_CONNECT, "/sbin/wlanctl-ng wlan0 lnxreq_autojoin ssid=$best_ssid authtype=opensystem |") or die "Cannot open connect $!\n"; *************** *** 194,198 **** $value =~ tr/'//d; $FINAL_CONNECT_Result{$var} = $value; ! # print "var $var is $value\n"; } --- 194,198 ---- $value =~ tr/'//d; $FINAL_CONNECT_Result{$var} = $value; ! # print "var $var is $value\n"; } *************** *** 210,239 **** if($FINAL_CONNECT_Result{resultcode} eq "success"){ print LOG "\tSuccessfully connected\n"; - - #open(LED, "/opt/bin/setLEDs 0|") or die "Cannot set LED $!\n"; - #sleep .2; - #open(LED, "/opt/bin/setLEDs 0 1|") or die "Cannot set LED $!\n"; - #sleep .2; - #open(LED, "/opt/bin/setLEDs 0 1 2|") or die "Cannot set LED $!\n"; - #sleep .2; - #open(LED, "/opt/bin/setLEDs 0 1 2 3|") or die "Cannot set LED $!\n"; - #sleep .2; - #open(LED, "/opt/bin/setLEDs 0 1 2 3 4|") or die "Cannot set LED $!\n"; - #sleep .2; - #open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5|") or die "Cannot set LED $!\n"; - #sleep .2; close(LOG); exit 0; } } ! ! print LOG "\tNo valid networks\n"; ! #open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5 6 7 |") or die "Cannot set LED $!\n"; ! #sleep 1; ! #open(LED, "/opt/bin/setLEDs |") or die "Cannot set LED $!\n"; ! #sleep 1; ! #open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5 6 7 |") or die "Cannot set LED $!\n"; ! #sleep 1; ! #open(LED, "/opt/bin/setLEDs |") or die "Cannot set LED $!\n"; close(LOG); --- 210,222 ---- if($FINAL_CONNECT_Result{resultcode} eq "success"){ print LOG "\tSuccessfully connected\n"; close(LOG); exit 0; + }else{ + print LOG "\tNot successfully connected\n"; } } ! else{ ! print LOG "\n\tNo valid networks found.\n"; ! } close(LOG); |
|
From: Ivan D. <idr...@us...> - 2006-06-14 01:24:49
|
Update of /cvsroot/terk/embed In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv2348 Modified Files: buildoptfs.sh Log Message: buildoptfs sets permissions to executables Index: buildoptfs.sh =================================================================== RCS file: /cvsroot/terk/embed/buildoptfs.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** buildoptfs.sh 13 Jun 2006 22:29:24 -0000 1.3 --- buildoptfs.sh 14 Jun 2006 01:24:46 -0000 1.4 *************** *** 61,70 **** try cp ${BASEDIR}/../embed/src/diagnostics/checkCFG ${BASEDIR}/edb9302/opt/bin - # Make executable - - try chmod a+x ${BASEDIR}/edb9302/opt/scripts/*.* - try chmod a+x ${BASEDIR}/edb9302/opt/bin/* - try chmod a+x ${BASEDIR}/edb9302/opt/fpga/* - # Copy website --- 61,64 ---- *************** *** 82,85 **** --- 76,87 ---- try cp ${BASEDIR}/../embed/www/files/NetworkConfig.txt ${BASEDIR}/edb9302/opt/www/files + # Make executable + + try chmod a+x ${BASEDIR}/edb9302/opt/scripts/*.* + try chmod a+x ${BASEDIR}/edb9302/opt/bin/* + try chmod a+x ${BASEDIR}/edb9302/opt/fpga/* + try chmod a+x ${BASEDIR}/edb9302/opt/www/* + try chmod a+x ${BASEDIR}/edb9302/opt/www/cgi-bin/* + # Build image |
|
From: Ivan D. <idr...@us...> - 2006-06-14 01:23:30
|
Update of /cvsroot/terk/embed/www/cgi-bin In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1919 Modified Files: wifiSave.cgi wiredSave.cgi Log Message: writing to config files bug fixed Index: wifiSave.cgi =================================================================== RCS file: /cvsroot/terk/embed/www/cgi-bin/wifiSave.cgi,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wifiSave.cgi 9 Jun 2006 20:24:21 -0000 1.1 --- wifiSave.cgi 14 Jun 2006 01:23:24 -0000 1.2 *************** *** 1,6 **** #!/opt/bin/microperl ! open (CONFIG, ">", "/opt/config.wlan0") or die "Cannot open config.wlan0... $!\n"; @values = split(/&/,$ENV{'QUERY_STRING'}); --- 1,18 ---- #!/opt/bin/microperl + $file = '/opt/config.wlan0'; # Config file + open (CONFIG, ">$file"); # Open for output ! $logfile = '/opt/connectlog0.txt'; # Log file ! open(LOG, ">>$logfile"); # Open for appending ! ! print LOG "wifiSave.cgi\n"; ! ! #open (CONFIG, ">", "/opt/config.wlan0") or die "Cannot open config.wlan0... $!\n"; ! ! foreach $env_var (split(/\n/, `/usr/bin/env`)) { ! $env_var =~ /([^=]+)=(.*)/; ! $ENV{$1} = $2; ! }; @values = split(/&/,$ENV{'QUERY_STRING'}); *************** *** 9,19 **** ($varname, $value) = split(/=/, $i); $data{$varname} = $value; ! print TEST "$varname = $value\n"; } if($data{isSSIDAuto} eq 'true'){ print CONFIG "auto=true\n"; } else { print CONFIG "auto=false\n"; } --- 21,33 ---- ($varname, $value) = split(/=/, $i); $data{$varname} = $value; ! print LOG "$varname = $value\n"; } if($data{isSSIDAuto} eq 'true'){ print CONFIG "auto=true\n"; + print LOG "auto=true\n"; } else { print CONFIG "auto=false\n"; + print LOG "auto=false\n"; } *************** *** 23,29 **** --- 37,49 ---- print CONFIG "networkKey=$data{networkKey}\n"; + print LOG "\tssid=$data{ssid}\n"; + print LOG "\tnetworkStructure=$data{networkStructure}\n"; + print LOG "\tdataEncryption=$data{dataEncryption}\n"; + print LOG "\tnetworkKey=$data{networkKey}\n"; + close CONFIG; print "Content-type: text/html\n\n"; + print "<script language=\"JavaScript\">; Index: wiredSave.cgi =================================================================== RCS file: /cvsroot/terk/embed/www/cgi-bin/wiredSave.cgi,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wiredSave.cgi 9 Jun 2006 20:24:21 -0000 1.1 --- wiredSave.cgi 14 Jun 2006 01:23:24 -0000 1.2 *************** *** 1,5 **** #!/opt/bin/microperl ! open CONFIG, ">", "/opt/config.eth0"; @values = split(/&/,$ENV{'QUERY_STRING'}); --- 1,16 ---- #!/opt/bin/microperl ! $file = '/opt/config.eth0'; # Config file ! open(CONFIG, ">$file"); # Open for output ! ! $logfile = '/opt/connectlog0.txt'; # Log file ! open(LOG, ">>$logfile"); # Open for appending ! ! print LOG "wiredSave.cgi\n"; ! ! foreach $env_var (split(/\n/, `/usr/bin/env`)) { ! $env_var =~ /([^=]+)=(.*)/; ! $ENV{$1} = $2; ! } @values = split(/&/,$ENV{'QUERY_STRING'}); *************** *** 11,14 **** --- 22,26 ---- print CONFIG "useDHCP=$data{isIPAuto}\n"; + print LOG "useDHCP=$data{isIPAuto}\n"; $IP = combineIP($data{IPaddress1}, $data{IPaddress2}, $data{IPaddress3}, $data{IPaddress4}); *************** *** 25,28 **** --- 37,48 ---- print CONFIG "secondaryDNS=$secondaryDNS\n"; + print LOG "\taddress=$IP\n"; + print LOG "\tmask=$mask\n"; + print LOG "\tgateway=$gateway\n"; + print LOG "\tisDNSAuto=$data{isDNSAuto}\n"; + print LOG "\tprimaryDNS=$primaryDNS\n"; + print LOG "\tsecondaryDNS=$secondaryDNS\n"; + + close CONFIG; |
|
From: Ivan D. <idr...@us...> - 2006-06-13 22:29:26
|
Update of /cvsroot/terk/embed In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29514 Modified Files: buildoptfs.sh Log Message: buildoptfs sets all in /opt/fpga as executable Index: buildoptfs.sh =================================================================== RCS file: /cvsroot/terk/embed/buildoptfs.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildoptfs.sh 13 Jun 2006 22:08:56 -0000 1.2 --- buildoptfs.sh 13 Jun 2006 22:29:24 -0000 1.3 *************** *** 65,69 **** try chmod a+x ${BASEDIR}/edb9302/opt/scripts/*.* try chmod a+x ${BASEDIR}/edb9302/opt/bin/* ! # Copy website --- 65,70 ---- try chmod a+x ${BASEDIR}/edb9302/opt/scripts/*.* try chmod a+x ${BASEDIR}/edb9302/opt/bin/* ! try chmod a+x ${BASEDIR}/edb9302/opt/fpga/* ! # Copy website |
|
From: Ivan D. <idr...@us...> - 2006-06-13 22:08:58
|
Update of /cvsroot/terk/embed In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20671 Modified Files: buildoptfs.sh Log Message: buildoptfs now gives all files in /opt/bin and /opt/scripts executable permissions Index: buildoptfs.sh =================================================================== RCS file: /cvsroot/terk/embed/buildoptfs.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** buildoptfs.sh 13 Jun 2006 20:44:06 -0000 1.1 --- buildoptfs.sh 13 Jun 2006 22:08:56 -0000 1.2 *************** *** 60,63 **** --- 60,68 ---- try cp ${BASEDIR}/../embed/test/leds/setLEDs ${BASEDIR}/edb9302/opt/bin try cp ${BASEDIR}/../embed/src/diagnostics/checkCFG ${BASEDIR}/edb9302/opt/bin + + # Make executable + + try chmod a+x ${BASEDIR}/edb9302/opt/scripts/*.* + try chmod a+x ${BASEDIR}/edb9302/opt/bin/* # Copy website *************** *** 76,82 **** try cp ${BASEDIR}/../embed/www/files/NetworkConfig.txt ${BASEDIR}/edb9302/opt/www/files ! #BASEDIR=`cd cirrus-arm-linux-1.0.4/;` build_rwfs ${BASEDIR}/edb9302/opt edb9302 echo "Writable filesystem successfully created!" --- 81,88 ---- try cp ${BASEDIR}/../embed/www/files/NetworkConfig.txt ${BASEDIR}/edb9302/opt/www/files ! # Build image build_rwfs ${BASEDIR}/edb9302/opt edb9302 + echo "Writable filesystem successfully created!" |
|
From: Ivan D. <idr...@us...> - 2006-06-13 21:53:50
|
Update of /cvsroot/terk/embed/util/fpgac In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14313 Added Files: fpgac Log Message: fpgac perm --- NEW FILE: fpgac --- (This appears to be a binary file; contents omitted.) |
|
From: Ivan D. <idr...@us...> - 2006-06-13 21:52:16
|
Update of /cvsroot/terk/embed/util/fpgac In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13825 Removed Files: fpgac Log Message: fpgac perm --- fpgac DELETED --- |
|
From: Ivan D. <idr...@us...> - 2006-06-13 21:29:02
|
Update of /cvsroot/terk/embed/util/fpgac In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv3504 Added Files: fpgac Log Message: fpgac perm --- NEW FILE: fpgac --- (This appears to be a binary file; contents omitted.) |
|
From: Ivan D. <idr...@us...> - 2006-06-13 21:27:47
|
Update of /cvsroot/terk/embed/util/fpgac In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv3036 Removed Files: fpgac Log Message: fpgac perm --- fpgac DELETED --- |
|
From: Ivan D. <idr...@us...> - 2006-06-13 21:06:12
|
Update of /cvsroot/terk/embed/util/fpgac In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25737/util/fpgac Added Files: fpgac Log Message: recovering: adding more binaries --- NEW FILE: fpgac --- (This appears to be a binary file; contents omitted.) |
|
From: Ivan D. <idr...@us...> - 2006-06-13 20:54:47
|
Update of /cvsroot/terk/embed/src/diagnostics In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20494/src/diagnostics Added Files: Makefile Log Message: recovering: adding diag Makefile --- NEW FILE: Makefile --- TARGET=checkCFG CXX=arm-linux-g++ CFLAGS=-I../../include LDFLAGS=-L../../lib -lqwerk -lpthread SRCS=$(wildcard *.cxx) OBJECTS=$(SRCS:.cxx=.o) $(TARGET): $(OBJECTS) libqwerk.a $(CXX) $(OBJECTS) -o $(TARGET) $(LDFLAGS) libqwerk.a: $(MAKE) -C ../../src/libqwerk clean: -rm -f *.o -rm -f *.a %.o: %.cxx $(CXX) -c $(CFLAGS) $< |
|
From: Ivan D. <idr...@us...> - 2006-06-13 20:53:32
|
Update of /cvsroot/terk/embed/src/diagnostics In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19949/src/diagnostics Added Files: checkCFG.h displayID.h qwerkmenu.h testmotor.h testservo.h checkCFG.cxx displayID.cxx testmotor.cxx testservo.cxx Log Message: recovering: adding more files --- NEW FILE: qwerkmenu.h --- #ifndef _QWERKMENU_H #define _QWERKMENU_H #define CFG_PERIOD 2000 #define PERIOD 1500 // time for digit to be displayed (msec) #define EMPTY 0 // "all LEDs off" mask #define FULL 255 // "all LEDs on " mask #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "qwerkhw.h" #include "timeutil.h" #include "displayID.h" #include "testmotor.h" #include "testservo.h" class CQwerkMenu { public: CQwerkMenu() { m_pQwerk = new CQwerkHardware(); cfgState = false; cfgStatePrev = false; cfgCount = 0; execute = false; exit = false; gettimeofday(&cfgTimeoutTime, NULL); } void CQwerkMenu::LaunchMenu() { exit = false; FlashLEDs(7, 60); while(!exit) { UpdateCFG(); if (execute) LaunchMenuItem(cfgCount-1); } } private: CQwerkHardware *m_pQwerk; //parent bool cfgState; bool cfgStatePrev; int cfgCount; bool execute; bool exit; struct timeval cfgLastPressTime; struct timeval cfgTimeoutTime; struct timeval curTime; void FlashLEDs(int leds, int times) { int i, j; for (i=0; i<times; i++) { for (j=0; j<=leds; j++) m_pQwerk->SetLED(j, true); Wait(10); for (j=0; j<=leds; j++) m_pQwerk->SetLED(j, false); Wait(10); } } void Wait (int msec) { usleep(msec*1000); } void UpdateCFG() { // ***** update button states ************ cfgStatePrev = cfgState; cfgState = m_pQwerk->GetConfigSwitch(); // ***** CFG press event ***************** if (cfgState && !cfgStatePrev) { cfgCount++; m_pQwerk->SetLED(cfgCount-1, true); //add time to timeout value gettimeofday(&cfgTimeoutTime, NULL); TIMEVAL_ADD_MSEC(&cfgTimeoutTime, CFG_PERIOD); } // ***** check for timeout *************** else { gettimeofday(&curTime, NULL); if (TIMEVAL_CMP(&curTime, &cfgTimeoutTime) > 0) if (cfgCount > 0) execute = true; } } void LaunchMenuItem(int n) { // ***** reset counters ***************** execute = false; cfgCount = 0; // ***** display menu item selection **** FlashLEDs(n, 20); // ***** launch programs ***************** if (n == 0) DisplayRobotID(); else if (n == 1) TestMotorsPWM(); else if (n == 2) TestServos(); else if (n >= 7) { m_pQwerk->SetLEDs(EMPTY); exit = true; return; } // ***** display program finished ******* FlashLEDs(7, 20); } }; #endif --- NEW FILE: checkCFG.h --- #ifndef _CHECKCFG_H #define _CHECKCFG_H #endif --- NEW FILE: testmotor.h --- #ifndef __TESTMOTOR_H__ #define __TESTMOTOR_H__ void TestMotorsPWM(); void TestMotorsMove(); #endif --- NEW FILE: displayID.h --- #ifndef __DISPLAY_ID_H__ #define __DISPLAY_ID_H__ #define DIGITS 28 // number of SN digits #define KEY 0x9A77013E #define MOD 0x00000FFD #define FILE "/opt/robotid.txt" #define PERIOD 2000 // time for digit to be displayed (msec) #define EMPTY 0 // "all LEDs off" mask #define FULL 255 // "all LEDs on " mask void DisplayRobotID(); void Encode (unsigned long name, unsigned long pass, int* id); void PrintID(int* id); int GetOctalDigit(unsigned long number, unsigned int pos); void ReadFile (unsigned long * name, unsigned long * pass); void Wait(int msec); // ID: N5 P7 C2 P3 P11 N9 C0 P2 P6 N8 N11 N10 P0 C1 P10 C3 N7 N0 P5 N3 P8 P9 N2 N6 P1 P4 N1 N4 #endif --- NEW FILE: testservo.cxx --- #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "rcservo.h" #include "qwerkhw.h" void TestServos() { printf("testing servos:\n"); CQwerkHardware qwerk(NULL); CRCServo qwerkServos; int i, s; // ************* enable qwerkServos.Enable(); // ************* set for (s = 0; s < 4; s++) { printf("\ttesting servos %d %d %d %d ...\n", s*4+0, s*4+1, s*4+2, s*4+3); // display progress on LEDs qwerk.SetLED(s*2, true); qwerk.SetLED(s*2+1, true); // rotate 128 -> 255 for (i = 128; i <= 255; i++) { qwerkServos.SetPosition(s*4+0, i); qwerkServos.SetPosition(s*4+1, i); qwerkServos.SetPosition(s*4+2, i); qwerkServos.SetPosition(s*4+3, i); usleep(2000); } // rotate 255 -> 0 for (i = 255; i >= 0; i--) { qwerkServos.SetPosition(s*4+0, i); qwerkServos.SetPosition(s*4+1, i); qwerkServos.SetPosition(s*4+2, i); qwerkServos.SetPosition(s*4+3, i); usleep(2000); } // rotate 0 -> 128 for (i = 0; i <= 128; i++) { qwerkServos.SetPosition(s*4+0, i); qwerkServos.SetPosition(s*4+1, i); qwerkServos.SetPosition(s*4+2, i); qwerkServos.SetPosition(s*4+3, i); usleep(2000); } } // ************* disable qwerk.SetLEDs(0); qwerkServos.Disable(); } --- NEW FILE: displayID.cxx --- #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <iostream> #include <fstream> #include <math.h> #include <string> using namespace std; #include "qwerkhw.h" #include "displayID.h" void DisplayRobotID() { // ***************************** variables CQwerkHardware hardware(NULL); // the qwerk board unsigned long name; // username unsigned long pass; // password int id[DIGITS]; // array of octal ID digits int* p_id = id; // pointer unsigned char stateMask; // LED state mask // ***************************** read file ReadFile(&name, &pass); // ***************************** encode Encode(name, pass, p_id); cout << endl; // ***************************** loop, displaying serial number Wait(PERIOD); for (int i=0; i<DIGITS; i++) { // ************************* set LEDs to mask stateMask = 1<<id[i]; hardware.SetLEDs(stateMask); Wait(PERIOD*0.7); // ************************* set LEDs to empty hardware.SetLEDs(EMPTY); Wait(PERIOD*0.3); } } void ReadFile (unsigned long * name, unsigned long * pass) { ifstream::pos_type size; // ***************************** create stream ifstream file (FILE); if (file.is_open()) { // ************************* read data file >> hex >> *name; file >> hex >> *pass; cout << "Robot name & pass loaded" << endl; // ************************* close file.close(); } else cout << "Unable to open file" << endl; } void Encode (unsigned long name, unsigned long pass, int* id) { unsigned int csum; // checksum // ***************************** encode username, password, and checksum printf("username: \t\t%08X\n", name); printf("password: \t\t%08X\n", pass); csum = (name + pass)%MOD; name = name ^ KEY; pass = pass ^ KEY; printf("checksum:\t%08X\n\n", csum); // ***************************** encode id[ 0] = GetOctalDigit(name, 5); // 0 id[ 1] = GetOctalDigit(pass, 7); // 1 id[ 2] = GetOctalDigit(csum, 2); // 2 id[ 3] = GetOctalDigit(pass, 3); // 3 id[ 4] = GetOctalDigit(pass, 11); // 4 id[ 5] = GetOctalDigit(name, 9); // 5 id[ 6] = GetOctalDigit(csum, 0); // 6 id[ 7] = GetOctalDigit(pass, 2); // 7 id[ 8] = GetOctalDigit(pass, 6); // 8 id[ 9] = GetOctalDigit(name, 8); // 9 id[10] = GetOctalDigit(name, 11); // 10 id[11] = GetOctalDigit(name, 10); // 11 id[12] = GetOctalDigit(pass, 0); // 12 id[13] = GetOctalDigit(csum, 1); // 13 id[14] = GetOctalDigit(pass, 10); // 14 id[15] = GetOctalDigit(csum, 3); // 15 id[16] = GetOctalDigit(name, 7); // 16 id[17] = GetOctalDigit(name, 0); // 17 id[18] = GetOctalDigit(pass, 5); // 18 id[19] = GetOctalDigit(name, 3); // 19 id[20] = GetOctalDigit(pass, 8); // 20 id[21] = GetOctalDigit(pass, 9); // 21 id[22] = GetOctalDigit(name, 2); // 22 id[23] = GetOctalDigit(name, 6); // 23 id[24] = GetOctalDigit(pass, 1); // 24 id[25] = GetOctalDigit(pass, 4); // 25 id[26] = GetOctalDigit(name, 1); // 26 id[27] = GetOctalDigit(name, 4); // 27 // **************************** print ID PrintID(id); } void PrintID(int* id) { cout << "ENCODED ID octal: \t"; for (int i = 0; i < 28; i++) cout << id[i]; cout << endl; } int GetOctalDigit(unsigned long number, unsigned int pos) { return (unsigned int)(number / pow(8, pos)) % 8; } void Wait (int msec) { usleep(msec*1000); } --- NEW FILE: testservo.h --- #ifndef __TESTSERVO_H__ #define __TESTSERVO_H__ void TestServos(); #endif --- NEW FILE: checkCFG.cxx --- #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "qwerkhw.h" #include "qwerkmenu.h" int main() { CQwerkHardware qwerk(NULL); CQwerkMenu m; if (qwerk.GetConfigSwitch()) m.LaunchMenu(); return 0; } --- NEW FILE: testmotor.cxx --- #include <stdio.h> #include <unistd.h> #include "qemotortraj.h" #include "qwerkhw.h" #include "qegpioint.h" void TestMotorsPWM() { printf("testing motors PWM:\n"); CQwerkHardware qwerk(NULL); CQEMotorTraj motor(NULL, 0, 1, 2, 3); int i, m; for (m = 0; m < 4; m++) { printf("\ttesting motor %d...\n", m); for (i = 0; i <= 255; i++) { qwerk.SetLED(i/32, true); motor.SetPWM(m, i); usleep(2000); } for (i = 255; i >= 0; i--) { qwerk.SetLED(i/32, false); motor.SetPWM(m, i); usleep(2000); } for (i = 0; i >= -255; i--) { qwerk.SetLED(-i/32, true); motor.SetPWM(m, i); usleep(2000); } for (i = -255; i <= 0; i++) { qwerk.SetLED(-i/32, false); motor.SetPWM(m, i); usleep(2000); } qwerk.SetLEDs(0); } } void TestMotorsMove() { CQEMotorTraj motor(NULL, 0, 1, 2, 3); motor.SetPIDVGains(0, 100, 0, 0, 0); printf("running\n"); motor.Move(0, 40000, 20000, 10000); while(!motor.Done(0)); motor.Move(0, -20000, 20000, 10000); while(!motor.Done(0)); } /* motor.SetPIDVGains(0, 300, 0, 50, 0); motor.SetPIDVGains(1, 300, 0, 50, 0); motor.Hold(0, true); motor.Hold(1, true); motor.SetPosition(0, 10000); motor.SetPosition(1, 5000); */ //motor.MoveVelocity(0, 10000, 1); |
|
From: Ivan D. <idr...@us...> - 2006-06-13 20:53:26
|
Update of /cvsroot/terk/embed/src/terkapi In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19949/src/terkapi Added Files: Chat.cpp Chat.h Log Message: recovering: adding more files --- NEW FILE: Chat.cpp --- // ********************************************************************** // // Copyright (c) 2005 ZeroC, Inc. All rights reserved. // // This copy of Ice-E is licensed to you under the terms described in the // ICEE_LICENSE file included in this distribution. // // ********************************************************************** // Ice-E version 1.0.0 // Generated from file `Chat.ice' #include <Chat.h> #include <IceE/LocalException.h> #include <IceE/BasicStream.h> #ifndef ICEE_PURE_CLIENT # include <IceE/Object.h> #endif #include <IceE/LocalException.h> #ifndef ICEE_IGNORE_VERSION # if ICEE_INT_VERSION / 100 != 100 # error IceE version mismatch! # endif # if ICEE_INT_VERSION % 100 < 0 # error IceE patch level mismatch! # endif #endif #ifndef ICEE_PURE_CLIENT void IceInternal::incRef(::TeRK::Qwerk* p) { p->__incRef(); } void IceInternal::decRef(::TeRK::Qwerk* p) { p->__decRef(); } #endif // ICEE_PURE_CLIENT void IceInternal::incRef(::IceProxy::TeRK::Qwerk* p) { p->__incRef(); } void IceInternal::decRef(::IceProxy::TeRK::Qwerk* p) { p->__decRef(); } void TeRK::__write(::IceInternal::BasicStream* __os, const ::TeRK::QwerkPrx& v) { __os->write(::Ice::ObjectPrx(v)); } void TeRK::__read(::IceInternal::BasicStream* __is, ::TeRK::QwerkPrx& v) { ::Ice::ObjectPrx proxy; __is->read(proxy); if(!proxy) { v = 0; } else { v = new ::IceProxy::TeRK::Qwerk; v->__copyFrom(proxy); } } static const ::std::string __TeRK__Qwerk_ids[3] = { "::Ice::Object", "::TeRK::Qwerk", "::peer::PeerConnectionEventHandler" }; #ifndef ICEE_PURE_CLIENT bool TeRK::Qwerk::ice_isA(const ::std::string& _s, const ::Ice::Current&) const { return ::std::binary_search(__TeRK__Qwerk_ids, __TeRK__Qwerk_ids + 3, _s); } ::std::vector< ::std::string> TeRK::Qwerk::ice_ids(const ::Ice::Current&) const { return ::std::vector< ::std::string>(&__TeRK__Qwerk_ids[0], &__TeRK__Qwerk_ids[3]); } const ::std::string& TeRK::Qwerk::ice_id(const ::Ice::Current&) const { return __TeRK__Qwerk_ids[1]; } const ::std::string& TeRK::Qwerk::ice_staticId() { return __TeRK__Qwerk_ids[1]; } ::IceInternal::DispatchStatus TeRK::Qwerk::___cameraTiltUp(::IceInternal::Incoming& __in, const ::Ice::Current& __current) { cameraTiltUp(__current); return ::IceInternal::DispatchOK; } ::IceInternal::DispatchStatus TeRK::Qwerk::___cameraTiltDown(::IceInternal::Incoming& __in, const ::Ice::Current& __current) { cameraTiltDown(__current); return ::IceInternal::DispatchOK; } ::IceInternal::DispatchStatus TeRK::Qwerk::___cameraPanLeft(::IceInternal::Incoming& __in, const ::Ice::Current& __current) { cameraPanLeft(__current); return ::IceInternal::DispatchOK; } ::IceInternal::DispatchStatus TeRK::Qwerk::___cameraPanRight(::IceInternal::Incoming& __in, const ::Ice::Current& __current) { cameraPanRight(__current); return ::IceInternal::DispatchOK; } ::IceInternal::DispatchStatus TeRK::Qwerk::___driveForward(::IceInternal::Incoming& __in, const ::Ice::Current& __current) { driveForward(__current); return ::IceInternal::DispatchOK; } ::IceInternal::DispatchStatus TeRK::Qwerk::___driveBack(::IceInternal::Incoming& __in, const ::Ice::Current& __current) { driveBack(__current); return ::IceInternal::DispatchOK; } ::IceInternal::DispatchStatus TeRK::Qwerk::___spinLeft(::IceInternal::Incoming& __in, const ::Ice::Current& __current) { spinLeft(__current); return ::IceInternal::DispatchOK; } ::IceInternal::DispatchStatus TeRK::Qwerk::___spinRight(::IceInternal::Incoming& __in, const ::Ice::Current& __current) { spinRight(__current); return ::IceInternal::DispatchOK; } ::IceInternal::DispatchStatus TeRK::Qwerk::___stop(::IceInternal::Incoming& __in, const ::Ice::Current& __current) { stop(__current); return ::IceInternal::DispatchOK; } static ::std::string __TeRK__Qwerk_all[] = { "cameraPanLeft", "cameraPanRight", "cameraTiltDown", "cameraTiltUp", "driveBack", "driveForward", "ice_id", "ice_ids", "ice_isA", "ice_ping", "peerConnected", "peerConnectedNoProxy", "peerDisconnected", "spinLeft", "spinRight", "stop" }; ::IceInternal::DispatchStatus TeRK::Qwerk::__dispatch(::IceInternal::Incoming& in, const ::Ice::Current& current) { ::std::pair< ::std::string*, ::std::string*> r = ::std::equal_range(__TeRK__Qwerk_all, __TeRK__Qwerk_all + 16, current.operation); if(r.first == r.second) { return ::IceInternal::DispatchOperationNotExist; } switch(r.first - __TeRK__Qwerk_all) { case 0: { return ___cameraPanLeft(in, current); } case 1: { return ___cameraPanRight(in, current); } case 2: { return ___cameraTiltDown(in, current); } case 3: { return ___cameraTiltUp(in, current); } case 4: { return ___driveBack(in, current); } case 5: { return ___driveForward(in, current); } case 6: { return ___ice_id(in, current); } case 7: { return ___ice_ids(in, current); } case 8: { return ___ice_isA(in, current); } case 9: { return ___ice_ping(in, current); } case 10: { return ___peerConnected(in, current); } case 11: { return ___peerConnectedNoProxy(in, current); } case 12: { return ___peerDisconnected(in, current); } case 13: { return ___spinLeft(in, current); } case 14: { return ___spinRight(in, current); } case 15: { return ___stop(in, current); } } assert(false); return ::IceInternal::DispatchOperationNotExist; } bool TeRK::operator==(const ::TeRK::Qwerk& l, const ::TeRK::Qwerk& r) { return static_cast<const ::Ice::Object&>(l) == static_cast<const ::Ice::Object&>(r); } bool TeRK::operator!=(const ::TeRK::Qwerk& l, const ::TeRK::Qwerk& r) { return static_cast<const ::Ice::Object&>(l) != static_cast<const ::Ice::Object&>(r); } bool TeRK::operator<(const ::TeRK::Qwerk& l, const ::TeRK::Qwerk& r) { return static_cast<const ::Ice::Object&>(l) < static_cast<const ::Ice::Object&>(r); } #endif // ICEE_PURE_CLIENT void IceProxy::TeRK::Qwerk::cameraTiltUp() { cameraTiltUp(__defaultContext()); } void IceProxy::TeRK::Qwerk::cameraTiltUp(const ::Ice::Context& __ctx) { int __cnt = 0; while(true) { try { ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate(); ::IceDelegate::TeRK::Qwerk* __del = dynamic_cast< ::IceDelegate::TeRK::Qwerk*>(__delBase.get()); __del->cameraTiltUp(__ctx); return; } catch(const ::IceInternal::NonRepeatable& __ex) { __rethrowException(*__ex.get()); } catch(const ::Ice::LocalException& __ex) { __handleException(__ex, __cnt); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } } void IceProxy::TeRK::Qwerk::cameraTiltDown() { cameraTiltDown(__defaultContext()); } void IceProxy::TeRK::Qwerk::cameraTiltDown(const ::Ice::Context& __ctx) { int __cnt = 0; while(true) { try { ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate(); ::IceDelegate::TeRK::Qwerk* __del = dynamic_cast< ::IceDelegate::TeRK::Qwerk*>(__delBase.get()); __del->cameraTiltDown(__ctx); return; } catch(const ::IceInternal::NonRepeatable& __ex) { __rethrowException(*__ex.get()); } catch(const ::Ice::LocalException& __ex) { __handleException(__ex, __cnt); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } } void IceProxy::TeRK::Qwerk::cameraPanLeft() { cameraPanLeft(__defaultContext()); } void IceProxy::TeRK::Qwerk::cameraPanLeft(const ::Ice::Context& __ctx) { int __cnt = 0; while(true) { try { ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate(); ::IceDelegate::TeRK::Qwerk* __del = dynamic_cast< ::IceDelegate::TeRK::Qwerk*>(__delBase.get()); __del->cameraPanLeft(__ctx); return; } catch(const ::IceInternal::NonRepeatable& __ex) { __rethrowException(*__ex.get()); } catch(const ::Ice::LocalException& __ex) { __handleException(__ex, __cnt); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } } void IceProxy::TeRK::Qwerk::cameraPanRight() { cameraPanRight(__defaultContext()); } void IceProxy::TeRK::Qwerk::cameraPanRight(const ::Ice::Context& __ctx) { int __cnt = 0; while(true) { try { ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate(); ::IceDelegate::TeRK::Qwerk* __del = dynamic_cast< ::IceDelegate::TeRK::Qwerk*>(__delBase.get()); __del->cameraPanRight(__ctx); return; } catch(const ::IceInternal::NonRepeatable& __ex) { __rethrowException(*__ex.get()); } catch(const ::Ice::LocalException& __ex) { __handleException(__ex, __cnt); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } } void IceProxy::TeRK::Qwerk::driveForward() { driveForward(__defaultContext()); } void IceProxy::TeRK::Qwerk::driveForward(const ::Ice::Context& __ctx) { int __cnt = 0; while(true) { try { ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate(); ::IceDelegate::TeRK::Qwerk* __del = dynamic_cast< ::IceDelegate::TeRK::Qwerk*>(__delBase.get()); __del->driveForward(__ctx); return; } catch(const ::IceInternal::NonRepeatable& __ex) { __rethrowException(*__ex.get()); } catch(const ::Ice::LocalException& __ex) { __handleException(__ex, __cnt); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } } void IceProxy::TeRK::Qwerk::driveBack() { driveBack(__defaultContext()); } void IceProxy::TeRK::Qwerk::driveBack(const ::Ice::Context& __ctx) { int __cnt = 0; while(true) { try { ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate(); ::IceDelegate::TeRK::Qwerk* __del = dynamic_cast< ::IceDelegate::TeRK::Qwerk*>(__delBase.get()); __del->driveBack(__ctx); return; } catch(const ::IceInternal::NonRepeatable& __ex) { __rethrowException(*__ex.get()); } catch(const ::Ice::LocalException& __ex) { __handleException(__ex, __cnt); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } } void IceProxy::TeRK::Qwerk::spinLeft() { spinLeft(__defaultContext()); } void IceProxy::TeRK::Qwerk::spinLeft(const ::Ice::Context& __ctx) { int __cnt = 0; while(true) { try { ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate(); ::IceDelegate::TeRK::Qwerk* __del = dynamic_cast< ::IceDelegate::TeRK::Qwerk*>(__delBase.get()); __del->spinLeft(__ctx); return; } catch(const ::IceInternal::NonRepeatable& __ex) { __rethrowException(*__ex.get()); } catch(const ::Ice::LocalException& __ex) { __handleException(__ex, __cnt); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } } void IceProxy::TeRK::Qwerk::spinRight() { spinRight(__defaultContext()); } void IceProxy::TeRK::Qwerk::spinRight(const ::Ice::Context& __ctx) { int __cnt = 0; while(true) { try { ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate(); ::IceDelegate::TeRK::Qwerk* __del = dynamic_cast< ::IceDelegate::TeRK::Qwerk*>(__delBase.get()); __del->spinRight(__ctx); return; } catch(const ::IceInternal::NonRepeatable& __ex) { __rethrowException(*__ex.get()); } catch(const ::Ice::LocalException& __ex) { __handleException(__ex, __cnt); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } } void IceProxy::TeRK::Qwerk::stop() { stop(__defaultContext()); } void IceProxy::TeRK::Qwerk::stop(const ::Ice::Context& __ctx) { int __cnt = 0; while(true) { try { ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate(); ::IceDelegate::TeRK::Qwerk* __del = dynamic_cast< ::IceDelegate::TeRK::Qwerk*>(__delBase.get()); __del->stop(__ctx); return; } catch(const ::IceInternal::NonRepeatable& __ex) { __rethrowException(*__ex.get()); } catch(const ::Ice::LocalException& __ex) { __handleException(__ex, __cnt); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } } const ::std::string& IceProxy::TeRK::Qwerk::ice_staticId() { return __TeRK__Qwerk_ids[1]; } ::IceInternal::Handle< ::IceDelegate::Ice::Object> IceProxy::TeRK::Qwerk::__createDelegate() { return ::IceInternal::Handle< ::IceDelegate::Ice::Object>(new ::IceDelegate::TeRK::Qwerk); } bool IceProxy::TeRK::operator==(const ::IceProxy::TeRK::Qwerk& l, const ::IceProxy::TeRK::Qwerk& r) { return static_cast<const ::IceProxy::Ice::Object&>(l) == static_cast<const ::IceProxy::Ice::Object&>(r); } bool IceProxy::TeRK::operator!=(const ::IceProxy::TeRK::Qwerk& l, const ::IceProxy::TeRK::Qwerk& r) { return static_cast<const ::IceProxy::Ice::Object&>(l) != static_cast<const ::IceProxy::Ice::Object&>(r); } bool IceProxy::TeRK::operator<(const ::IceProxy::TeRK::Qwerk& l, const ::IceProxy::TeRK::Qwerk& r) { return static_cast<const ::IceProxy::Ice::Object&>(l) < static_cast<const ::IceProxy::Ice::Object&>(r); } void IceDelegate::TeRK::Qwerk::cameraTiltUp(const ::Ice::Context& __context) { static const ::std::string __operation("cameraTiltUp"); ::IceInternal::Outgoing __out(__connection.get(), __reference.get(), __operation, static_cast< ::Ice::OperationMode>(0), __context); bool __ok = __out.invoke(); try { ::IceInternal::BasicStream* __is = __out.is(); if(!__ok) { try { __is->throwException(); } catch(const ::Ice::UserException& __ex) { ::Ice::UnknownUserException __uex(__FILE__, __LINE__); __uex.unknown = __ex.ice_name(); throw __uex; } } } catch(const ::Ice::LocalException& __ex) { throw ::IceInternal::NonRepeatable(__ex); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } void IceDelegate::TeRK::Qwerk::cameraTiltDown(const ::Ice::Context& __context) { static const ::std::string __operation("cameraTiltDown"); ::IceInternal::Outgoing __out(__connection.get(), __reference.get(), __operation, static_cast< ::Ice::OperationMode>(0), __context); bool __ok = __out.invoke(); try { ::IceInternal::BasicStream* __is = __out.is(); if(!__ok) { try { __is->throwException(); } catch(const ::Ice::UserException& __ex) { ::Ice::UnknownUserException __uex(__FILE__, __LINE__); __uex.unknown = __ex.ice_name(); throw __uex; } } } catch(const ::Ice::LocalException& __ex) { throw ::IceInternal::NonRepeatable(__ex); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } void IceDelegate::TeRK::Qwerk::cameraPanLeft(const ::Ice::Context& __context) { static const ::std::string __operation("cameraPanLeft"); ::IceInternal::Outgoing __out(__connection.get(), __reference.get(), __operation, static_cast< ::Ice::OperationMode>(0), __context); bool __ok = __out.invoke(); try { ::IceInternal::BasicStream* __is = __out.is(); if(!__ok) { try { __is->throwException(); } catch(const ::Ice::UserException& __ex) { ::Ice::UnknownUserException __uex(__FILE__, __LINE__); __uex.unknown = __ex.ice_name(); throw __uex; } } } catch(const ::Ice::LocalException& __ex) { throw ::IceInternal::NonRepeatable(__ex); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } void IceDelegate::TeRK::Qwerk::cameraPanRight(const ::Ice::Context& __context) { static const ::std::string __operation("cameraPanRight"); ::IceInternal::Outgoing __out(__connection.get(), __reference.get(), __operation, static_cast< ::Ice::OperationMode>(0), __context); bool __ok = __out.invoke(); try { ::IceInternal::BasicStream* __is = __out.is(); if(!__ok) { try { __is->throwException(); } catch(const ::Ice::UserException& __ex) { ::Ice::UnknownUserException __uex(__FILE__, __LINE__); __uex.unknown = __ex.ice_name(); throw __uex; } } } catch(const ::Ice::LocalException& __ex) { throw ::IceInternal::NonRepeatable(__ex); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } void IceDelegate::TeRK::Qwerk::driveForward(const ::Ice::Context& __context) { static const ::std::string __operation("driveForward"); ::IceInternal::Outgoing __out(__connection.get(), __reference.get(), __operation, static_cast< ::Ice::OperationMode>(0), __context); bool __ok = __out.invoke(); try { ::IceInternal::BasicStream* __is = __out.is(); if(!__ok) { try { __is->throwException(); } catch(const ::Ice::UserException& __ex) { ::Ice::UnknownUserException __uex(__FILE__, __LINE__); __uex.unknown = __ex.ice_name(); throw __uex; } } } catch(const ::Ice::LocalException& __ex) { throw ::IceInternal::NonRepeatable(__ex); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } void IceDelegate::TeRK::Qwerk::driveBack(const ::Ice::Context& __context) { static const ::std::string __operation("driveBack"); ::IceInternal::Outgoing __out(__connection.get(), __reference.get(), __operation, static_cast< ::Ice::OperationMode>(0), __context); bool __ok = __out.invoke(); try { ::IceInternal::BasicStream* __is = __out.is(); if(!__ok) { try { __is->throwException(); } catch(const ::Ice::UserException& __ex) { ::Ice::UnknownUserException __uex(__FILE__, __LINE__); __uex.unknown = __ex.ice_name(); throw __uex; } } } catch(const ::Ice::LocalException& __ex) { throw ::IceInternal::NonRepeatable(__ex); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } void IceDelegate::TeRK::Qwerk::spinLeft(const ::Ice::Context& __context) { static const ::std::string __operation("spinLeft"); ::IceInternal::Outgoing __out(__connection.get(), __reference.get(), __operation, static_cast< ::Ice::OperationMode>(0), __context); bool __ok = __out.invoke(); try { ::IceInternal::BasicStream* __is = __out.is(); if(!__ok) { try { __is->throwException(); } catch(const ::Ice::UserException& __ex) { ::Ice::UnknownUserException __uex(__FILE__, __LINE__); __uex.unknown = __ex.ice_name(); throw __uex; } } } catch(const ::Ice::LocalException& __ex) { throw ::IceInternal::NonRepeatable(__ex); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } void IceDelegate::TeRK::Qwerk::spinRight(const ::Ice::Context& __context) { static const ::std::string __operation("spinRight"); ::IceInternal::Outgoing __out(__connection.get(), __reference.get(), __operation, static_cast< ::Ice::OperationMode>(0), __context); bool __ok = __out.invoke(); try { ::IceInternal::BasicStream* __is = __out.is(); if(!__ok) { try { __is->throwException(); } catch(const ::Ice::UserException& __ex) { ::Ice::UnknownUserException __uex(__FILE__, __LINE__); __uex.unknown = __ex.ice_name(); throw __uex; } } } catch(const ::Ice::LocalException& __ex) { throw ::IceInternal::NonRepeatable(__ex); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } void IceDelegate::TeRK::Qwerk::stop(const ::Ice::Context& __context) { static const ::std::string __operation("stop"); ::IceInternal::Outgoing __out(__connection.get(), __reference.get(), __operation, static_cast< ::Ice::OperationMode>(0), __context); bool __ok = __out.invoke(); try { ::IceInternal::BasicStream* __is = __out.is(); if(!__ok) { try { __is->throwException(); } catch(const ::Ice::UserException& __ex) { ::Ice::UnknownUserException __uex(__FILE__, __LINE__); __uex.unknown = __ex.ice_name(); throw __uex; } } } catch(const ::Ice::LocalException& __ex) { throw ::IceInternal::NonRepeatable(__ex); } #if defined(_MSC_VER) && (_MSC_VER == 1201) && defined(_M_ARM) // EVC4 SP4 bug. catch(...) { throw; } #endif } --- NEW FILE: Chat.h --- // ********************************************************************** // // Copyright (c) 2005 ZeroC, Inc. All rights reserved. // // This copy of Ice-E is licensed to you under the terms described in the // ICEE_LICENSE file included in this distribution. // // ********************************************************************** // Ice-E version 1.0.0 // Generated from file `Chat.ice' #ifndef __Chat_h__ #define __Chat_h__ #include <IceE/LocalObjectF.h> #include <IceE/ProxyF.h> #ifndef ICEE_PURE_CLIENT # include <IceE/ObjectF.h> #endif #include <IceE/Exception.h> #include <IceE/LocalObject.h> #include <IceE/Proxy.h> #ifndef ICEE_PURE_CLIENT # include <IceE/Object.h> # include <IceE/Incoming.h> #endif #include <IceE/Outgoing.h> #include <IceE/UserExceptionFactory.h> #include <IceE/FactoryTable.h> #include <MRPLPeer.h> #include <IceE/UndefSysMacros.h> #ifndef ICEE_IGNORE_VERSION # if ICEE_INT_VERSION / 100 != 100 # error IceE version mismatch! # endif # if ICEE_INT_VERSION % 100 < 0 # error IceE patch level mismatch! # endif #endif namespace IceProxy { namespace TeRK { class Qwerk; bool operator==(const Qwerk&, const Qwerk&); bool operator!=(const Qwerk&, const Qwerk&); bool operator<(const Qwerk&, const Qwerk&); } } namespace TeRK { #ifndef ICEE_PURE_CLIENT class Qwerk; bool operator==(const Qwerk&, const Qwerk&); bool operator!=(const Qwerk&, const Qwerk&); bool operator<(const Qwerk&, const Qwerk&); #endif // ICEE_PURE_CLIENT } namespace IceInternal { #ifndef ICEE_PURE_CLIENT void incRef(::TeRK::Qwerk*); void decRef(::TeRK::Qwerk*); #endif // ICEE_PURE_CLIENT void incRef(::IceProxy::TeRK::Qwerk*); void decRef(::IceProxy::TeRK::Qwerk*); } namespace TeRK { #ifndef ICEE_PURE_CLIENT typedef ::IceInternal::Handle< ::TeRK::Qwerk> QwerkPtr; #endif // ICEE_PURE_CLIENT typedef ::IceInternal::ProxyHandle< ::IceProxy::TeRK::Qwerk> QwerkPrx; void __write(::IceInternal::BasicStream*, const QwerkPrx&); void __read(::IceInternal::BasicStream*, QwerkPrx&); } namespace TeRK { } namespace TeRK { #ifndef ICEE_PURE_CLIENT class Qwerk : virtual public ::peer::PeerConnectionEventHandler { public: virtual bool ice_isA(const ::std::string&, const ::Ice::Current& = ::Ice::Current()) const; virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Current& = ::Ice::Current()) const; virtual const ::std::string& ice_id(const ::Ice::Current& = ::Ice::Current()) const; static const ::std::string& ice_staticId(); virtual void cameraTiltUp(const ::Ice::Current& = ::Ice::Current()) = 0; ::IceInternal::DispatchStatus ___cameraTiltUp(::IceInternal::Incoming&, const ::Ice::Current&); virtual void cameraTiltDown(const ::Ice::Current& = ::Ice::Current()) = 0; ::IceInternal::DispatchStatus ___cameraTiltDown(::IceInternal::Incoming&, const ::Ice::Current&); virtual void cameraPanLeft(const ::Ice::Current& = ::Ice::Current()) = 0; ::IceInternal::DispatchStatus ___cameraPanLeft(::IceInternal::Incoming&, const ::Ice::Current&); virtual void cameraPanRight(const ::Ice::Current& = ::Ice::Current()) = 0; ::IceInternal::DispatchStatus ___cameraPanRight(::IceInternal::Incoming&, const ::Ice::Current&); virtual void driveForward(const ::Ice::Current& = ::Ice::Current()) = 0; ::IceInternal::DispatchStatus ___driveForward(::IceInternal::Incoming&, const ::Ice::Current&); virtual void driveBack(const ::Ice::Current& = ::Ice::Current()) = 0; ::IceInternal::DispatchStatus ___driveBack(::IceInternal::Incoming&, const ::Ice::Current&); virtual void spinLeft(const ::Ice::Current& = ::Ice::Current()) = 0; ::IceInternal::DispatchStatus ___spinLeft(::IceInternal::Incoming&, const ::Ice::Current&); virtual void spinRight(const ::Ice::Current& = ::Ice::Current()) = 0; ::IceInternal::DispatchStatus ___spinRight(::IceInternal::Incoming&, const ::Ice::Current&); virtual void stop(const ::Ice::Current& = ::Ice::Current()) = 0; ::IceInternal::DispatchStatus ___stop(::IceInternal::Incoming&, const ::Ice::Current&); virtual ::IceInternal::DispatchStatus __dispatch(::IceInternal::Incoming&, const ::Ice::Current&); }; #endif // ICEE_PURE_CLIENT } namespace IceProxy { namespace TeRK { class Qwerk : virtual public ::IceProxy::peer::PeerConnectionEventHandler { public: void cameraTiltUp(); void cameraTiltUp(const ::Ice::Context&); void cameraTiltDown(); void cameraTiltDown(const ::Ice::Context&); void cameraPanLeft(); void cameraPanLeft(const ::Ice::Context&); void cameraPanRight(); void cameraPanRight(const ::Ice::Context&); void driveForward(); void driveForward(const ::Ice::Context&); void driveBack(); void driveBack(const ::Ice::Context&); void spinLeft(); void spinLeft(const ::Ice::Context&); void spinRight(); void spinRight(const ::Ice::Context&); void stop(); void stop(const ::Ice::Context&); static const ::std::string& ice_staticId(); private: virtual ::IceInternal::Handle< ::IceDelegate::Ice::Object> __createDelegate(); }; } } namespace IceDelegate { namespace TeRK { class Qwerk : virtual public ::IceDelegate::peer::PeerConnectionEventHandler { public: virtual void cameraTiltUp(const ::Ice::Context&); virtual void cameraTiltDown(const ::Ice::Context&); virtual void cameraPanLeft(const ::Ice::Context&); virtual void cameraPanRight(const ::Ice::Context&); virtual void driveForward(const ::Ice::Context&); virtual void driveBack(const ::Ice::Context&); virtual void spinLeft(const ::Ice::Context&); virtual void spinRight(const ::Ice::Context&); virtual void stop(const ::Ice::Context&); }; } } #endif |
|
From: Ivan D. <idr...@us...> - 2006-06-13 20:53:26
|
Update of /cvsroot/terk/embed/test/leds In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19949/test/leds Added Files: setLEDs Log Message: recovering: adding more files --- NEW FILE: setLEDs --- (This appears to be a binary file; contents omitted.) |
|
From: Ivan D. <idr...@us...> - 2006-06-13 20:53:26
|
Update of /cvsroot/terk/embed/test/led In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19949/test/led Added Files: setLED Log Message: recovering: adding more files --- NEW FILE: setLED --- (This appears to be a binary file; contents omitted.) |
|
From: Ivan D. <idr...@us...> - 2006-06-13 20:48:23
|
Update of /cvsroot/terk/embed/bin In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17469/bin Added Files: fpgac Log Message: committing binaries --- NEW FILE: fpgac --- (This appears to be a binary file; contents omitted.) |
|
From: Ivan D. <idr...@us...> - 2006-06-13 20:48:23
|
Update of /cvsroot/terk/embed/src/diagnostics In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17469/src/diagnostics Added Files: checkCFG Log Message: committing binaries --- NEW FILE: checkCFG --- (This appears to be a binary file; contents omitted.) |
|
From: Ivan D. <idr...@us...> - 2006-06-13 20:45:38
|
Update of /cvsroot/terk/embed In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15314 Added Files: Makefile buildoptfs.sh Log Message: recoverd, seperated embed from cirrus trees --- NEW FILE: buildoptfs.sh --- #!/bin/sh # The following script copies all the required files to the /opt directory # and creates the optfs.out image. exec 3>&1 echo Building r/w filesystem... >&3 # Get the rules for building the various packages. BASEDIR=`cd ../cirrus-arm-linux-1.0.4; pwd` echo $BASEDIR . ${BASEDIR}/buildrules # Create necessary directories try rm -rf ${BASEDIR}/edb9302/opt try mkdir -p ${BASEDIR}/edb9302/opt try mkdir -p ${BASEDIR}/edb9302/opt/scripts try mkdir -p ${BASEDIR}/edb9302/opt/fpga try mkdir -p ${BASEDIR}/edb9302/opt/www try mkdir -p ${BASEDIR}/edb9302/opt/www/cgi-bin try mkdir -p ${BASEDIR}/edb9302/opt/www/files try mkdir -p ${BASEDIR}/edb9302/opt/ice try mkdir -p ${BASEDIR}/edb9302/opt/bin try mkdir -p ${BASEDIR}/edb9302/opt/drivers # Copy C-R-I-T-I-C-A-L Files try cp ${BASEDIR}/../embed/util/fpgac/fpgac ${BASEDIR}/edb9302/opt/fpga try cp ${BASEDIR}/../embed/logic/qwerk/qwerk.bit ${BASEDIR}/edb9302/opt/fpga try cp ${BASEDIR}/../embed/src/drivers/qeinterrupt/qeinterrupt.ko ${BASEDIR}/edb9302/opt/drivers try cp ${BASEDIR}/../embed/src/drivers/qemotor/qemotor.ko ${BASEDIR}/edb9302/opt/drivers # Copy scripts try cp ${BASEDIR}/../embed/src/terkapi/terkServer ${BASEDIR}/edb9302/opt/ice try cp ${BASEDIR}/../embed/src/terkapi/config ${BASEDIR}/edb9302/opt/ice try cp ${BASEDIR}/../embed/src/scripts/autoconnect.pl ${BASEDIR}/edb9302/opt/scripts try cp ${BASEDIR}/../embed/src/scripts/getIP.pl ${BASEDIR}/edb9302/opt/scripts try cp ${BASEDIR}/../embed/src/scripts/robot.init ${BASEDIR}/edb9302/opt/scripts try cp ${BASEDIR}/../embed/src/scripts/scan.pl ${BASEDIR}/edb9302/opt/scripts try cp ${BASEDIR}/../embed/src/scripts/setHostname.pl ${BASEDIR}/edb9302/opt/scripts try cp ${BASEDIR}/../embed/src/scripts/showwlan.pl ${BASEDIR}/edb9302/opt/scripts try cp ${BASEDIR}/../embed/src/scripts/storeUnique.pl ${BASEDIR}/edb9302/opt/scripts try cp ${BASEDIR}/../embed/src/scripts/tryGateways.pl ${BASEDIR}/edb9302/opt/scripts try cp ${BASEDIR}/../embed/src/scripts/waitForPing.pl ${BASEDIR}/edb9302/opt/scripts try cp ${BASEDIR}/../embed/src/scripts/wifiConnect.pl ${BASEDIR}/edb9302/opt/scripts try cp ${BASEDIR}/../embed/src/scripts/wiredConnect.pl ${BASEDIR}/edb9302/opt/scripts try cp ${BASEDIR}/../embed/src/scripts/config.wlan0.default ${BASEDIR}/edb9302/opt/config.wlan0 try cp ${BASEDIR}/../embed/src/scripts/config.eth0.default ${BASEDIR}/edb9302/opt/config.eth0 # Copy binaries try cp ${BASEDIR}/../embed/bin/devmem ${BASEDIR}/edb9302/opt/bin try cp ${BASEDIR}/../embed/bin/microperl ${BASEDIR}/edb9302/opt/bin try cp ${BASEDIR}/../embed/test/led/setLED ${BASEDIR}/edb9302/opt/bin try cp ${BASEDIR}/../embed/test/leds/setLEDs ${BASEDIR}/edb9302/opt/bin try cp ${BASEDIR}/../embed/src/diagnostics/checkCFG ${BASEDIR}/edb9302/opt/bin # Copy website try cp ${BASEDIR}/../embed/www/index.html ${BASEDIR}/edb9302/opt/www try cp ${BASEDIR}/../embed/www/loglinks.html ${BASEDIR}/edb9302/opt/www try cp ${BASEDIR}/../embed/www/menu.html ${BASEDIR}/edb9302/opt/www try cp ${BASEDIR}/../embed/www/tcpip.html ${BASEDIR}/edb9302/opt/www try cp ${BASEDIR}/../embed/www/cgi-bin/web.xml ${BASEDIR}/edb9302/opt/www/cgi-bin try cp ${BASEDIR}/../embed/www/cgi-bin/status.cgi ${BASEDIR}/edb9302/opt/www/cgi-bin try cp ${BASEDIR}/../embed/www/cgi-bin/wifi.cgi ${BASEDIR}/edb9302/opt/www/cgi-bin try cp ${BASEDIR}/../embed/www/cgi-bin/wifiSave.cgi ${BASEDIR}/edb9302/opt/www/cgi-bin try cp ${BASEDIR}/../embed/www/cgi-bin/wired.cgi ${BASEDIR}/edb9302/opt/www/cgi-bin try cp ${BASEDIR}/../embed/www/cgi-bin/wiredSave.cgi ${BASEDIR}/edb9302/opt/www/cgi-bin try cp ${BASEDIR}/../embed/www/files/IPConfig.txt ${BASEDIR}/edb9302/opt/www/files try cp ${BASEDIR}/../embed/www/files/NetworkConfig.txt ${BASEDIR}/edb9302/opt/www/files #BASEDIR=`cd cirrus-arm-linux-1.0.4/;` build_rwfs ${BASEDIR}/edb9302/opt edb9302 echo "Writable filesystem successfully created!" exit 0 --- NEW FILE: Makefile --- .PHONY: all all: @make -C ./src ./buildoptfs.sh backup: mv /tftpboot/optfs.out /tftpboot/BetaBase/optfs.out.`date +%F_%T` overwrite: cp ../cirrus-arm-linux-1.0.4/edb9302/optfs.out /tftpboot/ install: backup overwrite clean: make -C ./src clean |
|
From: Ivan D. <idr...@us...> - 2006-06-13 20:44:12
|
Update of /cvsroot/terk/embed/src/terkapi In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15314/src/terkapi Modified Files: Client.cpp MotorControllerI.cpp vidserv.cpp vidserv_util.cpp Log Message: recoverd, seperated embed from cirrus trees Index: MotorControllerI.cpp =================================================================== RCS file: /cvsroot/terk/embed/src/terkapi/MotorControllerI.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MotorControllerI.cpp 6 Jun 2006 05:45:08 -0000 1.2 --- MotorControllerI.cpp 13 Jun 2006 20:44:06 -0000 1.3 *************** *** 72,83 **** void MotorControllerI::startMotorBufferRecord(const BooleanArray& motorMask, const Ice::Current&) { - //FIXME: consider motorMask - motors->Record(); } void MotorControllerI::stopMotorBufferRecord(const BooleanArray& motorMask, const Ice::Current&) { ! //FIXME: consider motorMask ! motors->RStop(); } --- 72,83 ---- void MotorControllerI::startMotorBufferRecord(const BooleanArray& motorMask, const Ice::Current&) { } void MotorControllerI::stopMotorBufferRecord(const BooleanArray& motorMask, const Ice::Current&) { ! int i; ! ! for (i = 0; i < QEMOT_NUM_MOTORS; i++) ! buffers[i].values.resize(0); } *************** *** 101,112 **** void MotorControllerI::setMotorBuffer(const BooleanArray& motorMask, const MotorBufferArray& motorBuffers, const Ice::Current&) { - unsigned int i, nmotors; - - nmotors = MIN(QEMOT_NUM_MOTORS,motorMask.size()); - - for (i = 0; i < nmotors; i++) { - if (motorMask[i]) - buffers[i].values = motorBuffers[i].values; - } } --- 101,104 ---- Index: Client.cpp =================================================================== RCS file: /cvsroot/terk/embed/src/terkapi/Client.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Client.cpp 6 Jun 2006 20:08:53 -0000 1.19 --- Client.cpp 13 Jun 2006 20:44:06 -0000 1.20 *************** *** 852,857 **** gpio = new CQEGpioInt(); hardware = new CQwerkHardware(NULL); - hardware->SetLED(0,true); - hardware->SetLED(1,true); leds = new CQELEDController(hardware); --- 852,855 ---- *************** *** 911,917 **** leds->LEDoff(3); leds->LEDoff(4); ! leds->LEDon(0); ! leds->LEDon(1); ! delete leds; delete hardware; --- 909,913 ---- leds->LEDoff(3); leds->LEDoff(4); ! delete leds; delete hardware; *************** *** 920,925 **** delete motors; - //if( status == EXIT_FAILURE ) - // system("/opt/scripts/reconnect.sh"); //try to connect and run terk server again return status; } --- 916,919 ---- Index: vidserv.cpp =================================================================== RCS file: /cvsroot/terk/embed/src/terkapi/vidserv.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** vidserv.cpp 8 Jun 2006 15:32:01 -0000 1.5 --- vidserv.cpp 13 Jun 2006 20:44:06 -0000 1.6 *************** *** 161,165 **** state->height = videowin.height; state->width = videowin.width; ! state->framesize = state->depth*state->width*state->height; printf("resolution = %dx%d\n", state->width, state->height); printf("depth = %d\n", state->depth); --- 161,165 ---- state->height = videowin.height; state->width = videowin.width; ! state->framesize = state->depth*state->width*state->height+512; printf("resolution = %dx%d\n", state->width, state->height); printf("depth = %d\n", state->depth); *************** *** 223,227 **** gettimeofday(&start, NULL); while (1) { ! gettimeofday(&startframe, NULL); if (!state->grabbing) break; --- 223,227 ---- gettimeofday(&start, NULL); while (1) { ! gettimeofday(&startframe, NULL); if (!state->grabbing) break; *************** *** 256,260 **** if (outfile) { fwrite(state->currframe, state->currframesize, 1, outfile); ! fclose(outfile); } } --- 256,260 ---- if (outfile) { fwrite(state->currframe, state->currframesize, 1, outfile); ! fclose(outfile); } } Index: vidserv_util.cpp =================================================================== RCS file: /cvsroot/terk/embed/src/terkapi/vidserv_util.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** vidserv_util.cpp 8 Jun 2006 15:32:01 -0000 1.3 --- vidserv_util.cpp 13 Jun 2006 20:44:06 -0000 1.4 *************** *** 108,112 **** break; case VIDEO_PALETTE_RAW: ! depth = 1; break; case VIDEO_PALETTE_YUV420P: --- 108,112 ---- break; case VIDEO_PALETTE_RAW: ! depth = 1; break; case VIDEO_PALETTE_YUV420P: *************** *** 140,146 **** int find = -1; int size = 0; ! /* Spca506 return more with channel video, cut it */ ! /* return Bridge otherwhise -1 */ for (i = 0; i < MAX_BRIDGE -1; i++) --- 140,146 ---- int find = -1; int size = 0; ! /* Spca506 return more with channel video, cut it */ ! /* return Bridge otherwhise -1 */ for (i = 0; i < MAX_BRIDGE -1; i++) *************** *** 178,182 **** case BRIDGE_CX11646: case BRIDGE_SN9CXXX: ! case BRIDGE_MR97311: type = JPEG; break; --- 178,182 ---- case BRIDGE_CX11646: case BRIDGE_SN9CXXX: ! case BRIDGE_MR97311: type = JPEG; break; |
|
From: Ivan D. <idr...@us...> - 2006-06-13 20:44:11
|
Update of /cvsroot/terk/embed/src/scripts In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15314/src/scripts Modified Files: autoconnect.pl getIP.pl scan.pl setHostname.pl showwlan.pl storeUnique.pl tryGateways.pl waitForPing.pl wifiConnect.pl wiredConnect.pl robot.init Log Message: recoverd, seperated embed from cirrus trees Index: showwlan.pl =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/showwlan.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** showwlan.pl 6 Jun 2006 18:31:26 -0000 1.2 --- showwlan.pl 13 Jun 2006 20:44:06 -0000 1.3 *************** *** 3,10 **** #use strict; if(! open WLANCONFIG, "/sbin/wlancfg show wlan0 |"){ ! open(SETLEDS, "/opt/bin/setLEDs 0 |") or die "Cannot set leds $!\n"; ! open(RECONNECT, "/opt/scripts/reconnect.sh |") or die "Cannot set leds $!\n"; ! exit 0; } else { while (<WLANCONFIG>) { --- 3,16 ---- #use strict; + $file = '/opt/connectlog0.txt'; # Log file + open(LOG, ">>$file"); # Open for appending + + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); + + printf LOG "%02d:%02d:%02d ", $hour, $min, $sec; + print LOG "showwlan.pl\n"; + if(! open WLANCONFIG, "/sbin/wlancfg show wlan0 |"){ ! die "Cannot open configfile"; } else { while (<WLANCONFIG>) { *************** *** 22,26 **** $ssid = $WLAN_Configuration{"dot11DesiredSSID"}; ! print "ssid: $ssid \n"; exit 0; --- 28,33 ---- $ssid = $WLAN_Configuration{"dot11DesiredSSID"}; ! print LOG "\tssid: $ssid \n"; + close(LOG); exit 0; Index: wifiConnect.pl =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/wifiConnect.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wifiConnect.pl 6 Jun 2006 18:31:26 -0000 1.6 --- wifiConnect.pl 13 Jun 2006 20:44:06 -0000 1.7 *************** *** 1,6 **** #!/opt/bin/microperl if(@ARGV != 1){ ! print "Usage is wifiConnect <adapter>\n"; exit; } --- 1,16 ---- #!/opt/bin/microperl + $file = '/opt/connectlog0.txt'; # Log file + open(LOG, ">>$file"); # Open for appending + + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); + + printf LOG "%02d:%02d:%02d ", $hour, $min, $sec; + print LOG "wifiConnect.pl\n"; + + if(@ARGV != 1){ ! print LOG "\tUsage is wifiConnect <adapter>\n"; ! close(LOG); exit; } *************** *** 8,25 **** $INTERFACE = $ARGV[0]; ! print "Connecting on $INTERFACE...\n"; ! open (CONFIG, "<", "/opt/config.$INTERFACE") or die "Cannot open configfile: $!"; ! while (<CONFIG>) { ! chomp; ! s/#.*//; ! s/^\s+//; ! s/\+$//; ! open(LEDS, "/opt/bin/setLEDs 0|") or die "Cannot set leds $!\n"; ! sleep .2; ! open(LEDS, "/opt/bin/setLEDs 0 1|") or die "Cannot set leds $!\n"; ! next unless length; ! my ($var, $value) = split(/\s*=\s*/, $_, 2); ! $Config{$var} = $value; } --- 18,35 ---- $INTERFACE = $ARGV[0]; ! print LOG "\tConnecting on $INTERFACE...\n"; ! if(! open CONFIG, "<", "/opt/config.$INTERFACE"){ ! die "Cannot open configfile: $!"; ! } else { ! while (<CONFIG>) { ! chomp; ! s/#.*//; ! s/^\s+//; ! s/\+$//; ! next unless length; ! my ($var, $value) = split(/\s*=\s*/, $_, 2); ! $Config{$var} = $value; ! } } *************** *** 27,72 **** $networkKey = $Config{"networkKey"}; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_ifstate ifstate=enable |") or die "wlanctl-ng failed $!\n"; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=p2CnfShortPreamble=long |") or die "wlanctl-ng failed $!\n"; if ($Config{"auto"} =~ m/true/){ ! print "Using autoconnect\n"; open(SCAN, "/opt/scripts/scan.pl |") or die "Cannot run scan.pl $!\n"; - - sleep 2; - open(AUTOCONNECT, "/opt/scripts/autoconnect.pl |") or die "Cannot run autoconnect.pl $!\n"; while(<AUTOCONNECT>){ chomp; ! print "$_ \n"; } } else { if($Config{"dataEncryption"} =~ m/wep/){ ! print "Connecting using encryption to $ssid\n"; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=dot11WEPDefaultKey=$networkKey |") or die "wlanctl-ng failed $!\n"; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=dot11WEPDefaultKeyID=0 |") or die "wlanctl-ng failed $!\n"; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=dot11ExcludeUnencrypted=true |") or die "wlanctl-ng failed $!\n"; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_autojoin ssid=$ssid authtype=opensystem |") or die "wlanctl-ng failed $!\n"; } else { ! print "Connecting unencrypted to $ssid\n"; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_autojoin ssid=$ssid authtype=opensystem |") or die "wlanctl-ng failed $!\n"; ! while(<WLANCTL>){ ! print "$_"; ! } ! open (RENEW, "/sbin/udhcpc -nq -i $INTERFACE|") or die "udhcpc failed $!\n"; ! while(<RENEW>){ ! print $_; ! } } ! ! open(SETLEDS,"/opt/bin/setLEDs 0 1 |") or die "Cannot set leds.\n"; } ! open(SETHOSTNAME, "/opt/scripts/setHostname.pl wlan0 |") or die "Failed to set host\name\ $!\n"; ! while(<SETHOSTNAME>){ ! print $_; ! } --- 37,73 ---- $networkKey = $Config{"networkKey"}; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_ifstate ifstate=enable |"); ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=p2CnfShortPreamble=long |"); ! if ($Config{"auto"} =~ m/true/){ ! print LOG "\tUsing autoconnect\n"; open(SCAN, "/opt/scripts/scan.pl |") or die "Cannot run scan.pl $!\n"; open(AUTOCONNECT, "/opt/scripts/autoconnect.pl |") or die "Cannot run autoconnect.pl $!\n"; while(<AUTOCONNECT>){ chomp; ! print LOG "\t$_ \n"; } } else { if($Config{"dataEncryption"} =~ m/wep/){ ! print LOG "\tConnecting using encryption to $ssid\n"; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=dot11WEPDefaultKey=$networkKey |"); ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=dot11WEPDefaultKeyID=0 |"); ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} dot11req_mibset mibattribute=dot11ExcludeUnencrypted=true |"); ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_autojoin ssid=$ssid authtype=opensystem |"); } else { ! print LOG "\tConnecting unencrypted to $ssid\n"; ! open(WLANCTL, "/sbin/wlanctl-ng ${INTERFACE} lnxreq_autojoin ssid=$ssid authtype=opensystem |"); } ! # open(SETLEDS, "/opt/bin/setLEDs 0 1 2 3 4 5|"); ! # sleep 1; ! # open(SETLEDS, "/opt/bin/setLEDs 0|"); ! # sleep 1; ! # open(SETLEDS, "/opt/bin/setLEDs 0 1 2 3 4 5|"); } ! close(LOG); Index: wiredConnect.pl =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/wiredConnect.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wiredConnect.pl 26 May 2006 22:05:29 -0000 1.4 --- wiredConnect.pl 13 Jun 2006 20:44:06 -0000 1.5 *************** *** 1,9 **** #!/opt/bin/microperl ! #$RELAY_IP = "128.2.211.159"; ! $RELAY_IP = "lion-o.terk.ri.cmu.edu"; if(@ARGV != 1){ ! print "Usage is wiredConnect <adapter>\n"; exit; } --- 1,15 ---- #!/opt/bin/microperl ! $file = '/opt/connectlog0.txt'; # Log file ! open(LOG, ">>$file"); # Open for appending ! ! ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); ! ! printf LOG "%02d:%02d:%02d ", $hour, $min, $sec; ! print LOG "wiredConnect.pl\n"; if(@ARGV != 1){ ! print LOG "\tUsage is wiredConnect <adapter>\n"; ! close(LOG); exit; } *************** *** 11,75 **** $INTERFACE = $ARGV[0]; ! open (CONFIG, "<", "/opt/config.$INTERFACE") or die "Cannot open configfile: $!"; ! while (<CONFIG>) { ! chomp; ! s/#.*//; ! s/^\s+//; ! s/\+$//; ! next unless length; ! $value = lc($value); ! my ($var, $value) = split(/\s*=\s*/, $_, 2); ! $Config{$var} = $value; } if($Config{"useDHCP"} =~ /true/){ ! print "Connecting on $INTERFACE using dhcp\n"; ! open (RENEW, "/sbin/udhcpc -nq -i $INTERFACE|") or die "udhcpc failed $!\n"; while(<RENEW>){ ! print $_; } ! open(IPGRAB, "/opt/scripts/getIP.pl $INTERFACE |") or die "getIP failed $!\n"; while(<IPGRAB>){ ! print $_; $ip = $_; } - if($ip){ - print "Registered on: $ip \n"; - print "Trying to ping relay... \n"; - - ($successes, $max_delay) = ping($RELAY_IP, 4); - - if($successes > 0){ - print "We had some successes pinging, yeah! Exiting\n"; - open(SETHOSTNAME, "/opt/scripts/setHostname.pl $INTERFACE |") or die "Failed to set hostname $!\n"; - while(<SETHOSTNAME>){ - print $_; - } - exit 0; - } else { - print "Ping failed, removing route.\n"; - - open (ROUTES, "/bin/netstat -nr |") or die "Cannot netstat $!\n"; - - while(<ROUTES>){ - chomp; - ($Destination, $Gateway, $Genmask, $Flags, $MSS, $Window, $irtt, $Iface) = split(); - if($Flags =~ m/UG/){ - print "$Gateway is a gateway on $Iface\n"; - $Gateways{$Iface} = $Gateway; - } - } - - open(DELROUTE, "/sbin/route del default gw $Gateways{$INTERFACE} |") or die "Failed to delete route $!\n"; - print "Removing gateway on $INTERFACE\n"; - print "/sbin/route del default gw $Gateways{$INTERFACE}\n"; - } - } else { - print "DHCP failed, setting to default static IP of 192.168.1.144 and mask of 255.255.255.0\n"; - open(IFCONFIG, "/sbin/ifconfig $INTERFACE 192.168.1.144 netmask 255.255.255.0 |") or die "ifconfig failed $!\n"; - } - } else { $ip = $Config{"address"}; --- 17,49 ---- $INTERFACE = $ARGV[0]; ! if(! open CONFIG, "<", "/opt/config.$INTERFACE"){ ! die "Cannot open configfile: $!"; ! } else { ! while (<CONFIG>) { ! chomp; ! s/#.*//; ! s/^\s+//; ! s/\+$//; ! next unless length; ! $value = lc($value); ! my ($var, $value) = split(/\s*=\s*/, $_, 2); ! $Config{$var} = $value; ! } } if($Config{"useDHCP"} =~ /true/){ ! print LOG "\tConnecting on $INTERFACE using dhcp\n"; ! open (RENEW, "/sbin/udhcpc -nq -i $INTERFACE|"); while(<RENEW>){ ! print LOG $_; } ! open(IPGRAB, "/opt/scripts/getIP.pl $INTERFACE |"); while(<IPGRAB>){ ! print LOG $_; $ip = $_; } + print LOG "\tRegistered on: $ip \n"; } else { $ip = $Config{"address"}; *************** *** 77,125 **** $gateway = $Config{"gateway"}; ! print "Connecting on $INTERFACE using static IP $ip\n"; ! open(IFCONFIG, "/sbin/ifconfig $INTERFACE $ip netmask $mask |") or die "ifconfig failed $!\n"; if($gateway){ ! print "Using gateway: $gateway\n"; ! open(GATEWAY, "/sbin/route add default gw $gateway |") or die "route add failed $!\n"; ! } ! } ! ! sub ping{ ! my $ip = $_[0]; ! my $attempts = $_[1]; ! # print "/bin/ping -c $attempts $ip \n"; ! open (PING, "/bin/ping -c $attempts $ip |") or die "ping failed $!\n";; ! ! while (<PING>) { ! # print "$_"; ! if (/^(\d+) packets transmitted, (\d+) /) { ! $pkts_sent = $1; ! $pkts_rcvd = $2; ! } ! elsif (/(\d+\.?\d*)\/(\d+\.?\d*)\/(\d+\.?\d*)/) { #look for num/num/num ! $min = $1; ! $avg = $2; ! $max = $3; ! } ! elsif (/^(\d+).*seq=(\d+).*ttl=(\d+).*time=(\d+\.?\d*) ms/) { ! # look for packet size seq=NN and time=NN ! $pkt_size[$pingI]=$1; ! $seq[$pingI]=$2; ! $ttl[$pingI]=$3; ! $rtt[$pingI]=$4; ! $pingI++; ! } elsif (/^(\d+).*seq=(\d+).*ttl=(\d+).*time=(\d+\.?\d*) usec/) { ! # look for packet size seq=NN and time=NN ! $pkt_size[$pingI]=$1; ! $seq[$pingI]=$2; ! $ttl[$pingI]=$3; ! $rtt[$pingI]=$4/1000; ! $pingI++; ! } ! elsif( /^interval: (\d+\.?\d*)/ ) { ! $interval = $1; ! } } - close (PING); - return ($pkts_rcvd, $max); } --- 51,59 ---- $gateway = $Config{"gateway"}; ! print LOG "\tConnecting on $INTERFACE using static IP $ip\n"; ! open(IFCONFIG, "/sbin/ifconfig $INTERFACE $ip netmask $mask |"); if($gateway){ ! print LOG "\tUsing gateway: $gateway\n"; ! open(GATEWAY, "/sbin/route add default gw $gateway |"); } } Index: storeUnique.pl =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/storeUnique.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** storeUnique.pl 19 Apr 2006 22:55:20 -0000 1.1 --- storeUnique.pl 13 Jun 2006 20:44:06 -0000 1.2 *************** *** 1,4 **** --- 1,12 ---- #!/opt/bin/microperl + $file = '/opt/connectlog0.txt'; # Log file + open(LOG, ">>$file"); # Open for appending + + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); + + printf LOG "%02d:%02d:%02d ", $hour, $min, $sec; + print LOG "storeUnique.pl\n"; + open(UNIQID, "/opt/bin/devmem 0x80832440 w |") or die "Cannot run devmem $!\n"; *************** *** 33,35 **** #print "$unique $random \n"; ! print IDFILE "$unique $random\n"; --- 41,46 ---- #print "$unique $random \n"; ! print LOG "\tsaving id and pass to file\n"; ! print IDFILE "$unique\n$random\n"; ! ! close(LOG); Index: setHostname.pl =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/setHostname.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** setHostname.pl 19 Apr 2006 20:46:24 -0000 1.1 --- setHostname.pl 13 Jun 2006 20:44:06 -0000 1.2 *************** *** 1,4 **** --- 1,11 ---- #!/opt/bin/microperl + $file = '/opt/connectlog0.txt'; # Log file + open(LOG, ">>$file"); # Open for appending + + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); + + printf LOG "%02d:%02d:%02d ", $hour, $min, $sec; + print LOG "setHostname.pl\n"; sub ifconfig2list() *************** *** 150,158 **** my($interfaceName) = shift; my(%interface) = %{$allInterfaces{$interfaceName}}; ! print "\n $interfaceName \n"; my($key,$value); ! print "\n\n[$interfaceName]======================================\n"; foreach $key (sort(keys(%interface))){ ! print "$key=" . $interface{$key} . "\n"; } } --- 157,165 ---- my($interfaceName) = shift; my(%interface) = %{$allInterfaces{$interfaceName}}; ! print LOG "\n\t $interfaceName \n"; my($key,$value); ! print LOG "\n\n\t[$interfaceName]======================================\n"; foreach $key (sort(keys(%interface))){ ! print LOG "\t$key=" . $interface{$key} . "\n"; } } *************** *** 177,181 **** if(@ARGV != 1){ ! print "Usage is setHostname <adapter>\n"; exit; } --- 184,189 ---- if(@ARGV != 1){ ! print LOG "\tUsage is setHostname <adapter>\n"; ! close (LOG); exit; } *************** *** 186,190 **** $hostname = getKey(%interfaces, $ARGV[0], "a_inet"); ! print "setting hostname to $hostname\n"; open(SETHOSTNAME, "/bin/hostname $hostname |") or die "Cannot run hostname $!\n"; --- 194,200 ---- $hostname = getKey(%interfaces, $ARGV[0], "a_inet"); ! print LOG "\tsetting hostname to $hostname\n"; open(SETHOSTNAME, "/bin/hostname $hostname |") or die "Cannot run hostname $!\n"; + + close(LOG); Index: waitForPing.pl =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/waitForPing.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** waitForPing.pl 6 Jun 2006 18:31:26 -0000 1.5 --- waitForPing.pl 13 Jun 2006 20:44:06 -0000 1.6 *************** *** 1,10 **** #!/opt/bin/microperl ! $RELAY_IP = "128.2.211.159"; $MAX_ATTEMPTS = 4; if(@ARGV != 1){ ! print "Usage is waitForPing <address>\n"; exit; } --- 1,19 ---- #!/opt/bin/microperl ! #require 'getIPlib.pl'; ! ! $file = '/opt/connectlog0.txt'; # Log file ! open(LOG, ">>$file"); # Open for appending ! ! ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); ! ! printf LOG "%02d:%02d:%02d ", $hour, $min, $sec; ! print LOG "waitForPing.pl\n"; $MAX_ATTEMPTS = 4; if(@ARGV != 1){ ! print LOG "\tUsage is waitForPing <address>\n"; ! close(LOG); exit; } *************** *** 15,94 **** $pkts_rcvd = 0; ! while(($successes == 0) && ($counter < $MAX_ATTEMPTS)){ # print "Trying to ping $IP\n"; ! if(($counter % 2 ) == 0){ ! open(LED, "/opt/bin/setLEDs 0 |") or die "Cannot set LED $!\n"; ! } else { ! open(LED, "/opt/bin/setLEDs 0 1 |") or die "Cannot set LED $!\n"; ! } ! ! ($successes, $max_delay) = ping($RELAY_IP, 4); ! ! $counter++; ! } ! ! if($counter < $MAX_ATTEMPTS){ ! print "pinged $IP succesfully after $counter attempts\n"; ! open(LED, "/opt/bin/setLEDs 0 1 6|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 6|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 1 |") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 |") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 1 6|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 6|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 1 |") or die "Cannot set LED $!\n"; ! } ! else{ ! print "failed to ping $IP, giving up\n"; ! #Blink ERROR no. 4 ! open(LED, "/opt/bin/setLEDs 0 1 7|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 7|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 1 |") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 |") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 1 7|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 7|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 1 |") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 |") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 1 7|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 7|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 1 |") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 |") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 1 7|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 7|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 1 |") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 |") or die "Cannot set LED $!\n"; ! ! # print "failed to ping $IP, trying different gateway configurations..\n"; ! # open(TRYGATEWAYS, "/opt/scripts/tryGateways.pl |"); ! } ! sub ping{ ! my $ip = $_[0]; ! my $attempts = $_[1]; ! # print "/bin/ping -c $attempts $ip \n"; ! open (PING, "/bin/ping -c $attempts $ip |") or die "ping failed $!\n";; while (<PING>) { ! # print "$_"; if (/^(\d+) packets transmitted, (\d+) /) { $pkts_sent = $1; --- 24,42 ---- $pkts_rcvd = 0; ! while(($pkts_rcvd == 0) && ($counter < $MAX_ATTEMPTS)){ # print "Trying to ping $IP\n"; ! # if(($counter % 2 ) == 0){ ! # open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5 6|") or die "Cannot set LED $!\n"; ! # } else { ! # open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5|") or die "Cannot set LED $!\n"; ! # } ! open (PING, "/bin/ping -c 1 $IP |"); ! $pkts_rcvd = 0; ! $pkts_sent = 0; ! $max = 0; while (<PING>) { ! # print LOG "$_"; if (/^(\d+) packets transmitted, (\d+) /) { $pkts_sent = $1; *************** *** 120,124 **** } close (PING); ! return ($pkts_rcvd, $max); } --- 68,84 ---- } close (PING); ! ! $counter++; } + if($counter < $MAX_ATTEMPTS){ + print LOG "\tpinged $IP succesfully after $counter attempts\n"; + + # open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5 6 7|") or die "Cannot set LED $!\n"; + open(TRYGATEWAYS, "/opt/scripts/tryGateways.pl |"); + + } + else{ + print LOG "\tfailed to ping $IP, trying different gateway configurations..\n"; + open(TRYGATEWAYS, "/opt/scripts/tryGateways.pl |"); + } Index: robot.init =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/robot.init,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** robot.init 6 Jun 2006 18:31:26 -0000 1.20 --- robot.init 13 Jun 2006 20:44:06 -0000 1.21 *************** *** 1,92 **** #!/bin/sh ! #Stage 0: Robot Configuration and Setup ! /opt/bin/setLEDs ! mv /opt/connectlog3.txt /opt/connectlog4.txt #Copy Logs ! /opt/bin/setLEDs 0 mv /opt/connectlog2.txt /opt/connectlog3.txt - /opt/bin/setLEDs mv /opt/connectlog1.txt /opt/connectlog2.txt - /opt/bin/setLEDs 0 mv /opt/connectlog0.txt /opt/connectlog1.txt ! /opt/bin/setLEDs ! echo `date +%R:%S` Generating robot ID... >> /opt/connectlog0.txt #Create ID ! /opt/bin/setLEDs 0 ! /opt/scripts/storeUnique.pl ! /opt/bin/setLEDs ! ! echo `date +%R:%S` Creating video device... >> /opt/connectlog0.txt #Mount Video ! /opt/bin/setLEDs 0 ! mknod /dev/video0 c 81 0 >> /opt/connectlog0.txt ! /opt/bin/setLEDs ! ! echo `date +%R:%S` Loading prism2_usb... >> /opt/connectlog0.txt #Mount USB ! /opt/bin/setLEDs 0 ! modprobe prism2_usb >> /opt/connectlog0.txt ! /opt/bin/setLEDs echo `date +%R:%S` Uploading fpga bitstream... >> /opt/connectlog0.txt #Configure FPGA - /opt/bin/setLEDs 0 /opt/fpga/fpgac /opt/fpga/qwerk.bit >> /opt/connectlog0.txt - /opt/bin/setLEDs echo `date +%R:%S` Loading Qwerk modules... >> /opt/connectlog0.txt #Mount QWERK Drivers - /opt/bin/setLEDs 0 insmod /opt/drivers/qeinterrupt.ko >> /opt/connectlog0.txt - /opt/bin/setLEDs insmod /opt/drivers/qemotor.ko >> /opt/connectlog0.txt - /opt/bin/setLEDs 0 echo `date +%R:%S` Linking web pages... >> /opt/connectlog0.txt #Link Webpages - /opt/bin/setLEDs rm /home/www/html - /opt/bin/setLEDs 0 rm /home/www/index.html - /opt/bin/setLEDs - - ln -s /opt/www/index.html /home/www/index.html - /opt/bin/setLEDs 0 - ln -s /opt/www/menu.html /home/www/menu.html - /opt/bin/setLEDs ln -s /opt/www/loglinks.html /home/www/loglinks.html - /opt/bin/setLEDs 0 - ln -s /opt/www/html /home/www/html - /opt/bin/setLEDs ! ln -s /opt/www/cgi-bin /home/www/cgi-bin ! /opt/bin/setLEDs 0 ! ln -s /opt/www/files /home/www/files ! /opt/bin/setLEDs ! ln -s /opt/connectlog0.txt /home/www/connectlog0.txt ! /opt/bin/setLEDs 0 ! ln -s /opt/connectlog1.txt /home/www/connectlog1.txt ! /opt/bin/setLEDs ! ! ln -s /opt/connectlog2.txt /home/www/connectlog2.txt ! /opt/bin/setLEDs 0 ! ln -s /opt/connectlog3.txt /home/www/connectlog3.txt ! /opt/bin/setLEDs ! ln -s /opt/connectlog4.txt /home/www/connectlog4.txt ! /opt/bin/setLEDs 0 ! echo `date +%R:%S` Checking for CFG button... >> /opt/connectlog0.txt #Check CFG ! /opt/bin/setLEDs ! /opt/bin/checkCFG ! /opt/bin/setLEDs 0 ! echo `date +%R:%S` Connecting to the wired network... >> /opt/connectlog0.txt ! /opt/bin/setLEDs ! /opt/scripts/wiredConnect.pl eth0 >> /opt/connectlog0.txt ! /opt/bin/setLEDs 0 - echo `date +%R:%S` Mounting nfs... >> /opt/connectlog0.txt #Mount NFS - /opt/bin/setLEDs - mount -t nfs -o nolock 192.168.1.103:/edbnfs /mnt >> /opt/connectlog0.txt - /opt/bin/setLEDs 0 - #Stage 1 & 2: Connect - /opt/scripts/reconnect.sh - exit 0 --- 1,80 ---- #!/bin/sh ! #################### Stage 0.0: Logs and basic Hardware ############################################ ! ! /opt/bin/setLEDs ! ! mv /opt/connectlog3.txt /opt/connectlog4.txt #Copy Logs mv /opt/connectlog2.txt /opt/connectlog3.txt mv /opt/connectlog1.txt /opt/connectlog2.txt mv /opt/connectlog0.txt /opt/connectlog1.txt ! echo `date +%R:%S` Copied logs. >> /opt/connectlog0.txt echo `date +%R:%S` Uploading fpga bitstream... >> /opt/connectlog0.txt #Configure FPGA /opt/fpga/fpgac /opt/fpga/qwerk.bit >> /opt/connectlog0.txt echo `date +%R:%S` Loading Qwerk modules... >> /opt/connectlog0.txt #Mount QWERK Drivers insmod /opt/drivers/qeinterrupt.ko >> /opt/connectlog0.txt insmod /opt/drivers/qemotor.ko >> /opt/connectlog0.txt + #################### Stage 0.1: Generate Unique mubers, checking for CFG ########################### + + echo `date +%R:%S` Generating robot ID... >> /opt/connectlog0.txt #Create ID + /opt/scripts/storeUnique.pl + + echo `date +%R:%S` Checking for CFG button... >> /opt/connectlog0.txt #Check CFG + /opt/bin/checkCFG + + #################### Stage 0.2: Webpages and Misc Devices ######################################### + + /opt/bin/setLEDs 0 + echo `date +%R:%S` Loading prism2_usb... >> /opt/connectlog0.txt #Mount USB + modprobe prism2_usb >> /opt/connectlog0.txt + + /opt/bin/setLEDs + echo `date +%R:%S` Creating video device... >> /opt/connectlog0.txt #Mount Video + mknod /dev/video0 c 81 0 >> /opt/connectlog0.txt + + /opt/bin/setLEDs 0 echo `date +%R:%S` Linking web pages... >> /opt/connectlog0.txt #Link Webpages rm /home/www/html rm /home/www/index.html + /opt/bin/setLEDs + ln -s /opt/www/index.html /home/www/index.html + ln -s /opt/www/menu.html /home/www/menu.html + ln -s /opt/www/tcpip.html /home/www/tcpip.html ln -s /opt/www/loglinks.html /home/www/loglinks.html ! /opt/bin/setLEDs 0 ! ln -s /opt/www/html /home/www/html ! ln -s /opt/www/cgi-bin /home/www/cgi-bin ! ln -s /opt/www/files /home/www/files ! /opt/bin/setLEDs 1 ! ln -s /opt/connectlog0.txt /home/www/connectlog0.txt ! ln -s /opt/connectlog1.txt /home/www/connectlog1.txt ! ln -s /opt/connectlog2.txt /home/www/connectlog2.txt ! ln -s /opt/connectlog3.txt /home/www/connectlog3.txt ! ln -s /opt/connectlog4.txt /home/www/connectlog4.txt ! #################### Stage 1 & 2: Network Connect##################################################### ! /opt/bin/setLEDs ! ! /opt/scripts/wifiConnect.pl wlan0 >> /opt/connect.log ! /opt/scripts/wiredConnect.pl eth0 >> /opt/connect.log ! ! udhcpc -i wlan0 -b -p /var/run/udhcpc.wlan0 >/dev/null 2>&1 >> /opt/connect.log ! ! mount -t nfs -o nolock 192.168.1.103:/edbnfs /mnt >> /opt/connect.log ! ! sleep 5; ! ! /opt/scripts/waitForPing.pl 128.2.211.159 >> /opt/connect.log ! ! cd /opt/ice ! /opt/ice/terkServer & Index: scan.pl =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/scan.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** scan.pl 14 Apr 2006 16:08:05 -0000 1.1 --- scan.pl 13 Jun 2006 20:44:06 -0000 1.2 *************** *** 1,4 **** --- 1,12 ---- #!/opt/bin/microperl + $file = '/opt/connectlog0.txt'; # Log file + open(LOG, ">>$file"); # Open for appending + + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); + + printf LOG "%02d:%02d:%02d ", $hour, $min, $sec; + print LOG "scan.pl\n"; + open(SCAN, "/sbin/wlanctl-ng wlan0 dot11req_scan bsstype=infrastructure bssid=ff:ff:ff:ff:ff:ff ssid= scantype=active probedelay=100 channellist=01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e minchanneltime=10 maxchanneltime=100 |") or die "Cannot run scan: $!\n"; *************** *** 16,22 **** $resultcode = $SCAN_results{"resultcode"}; ! print "result code is $resultcode\n"; close(SCAN); exit 0; --- 24,32 ---- $resultcode = $SCAN_results{"resultcode"}; ! print LOG "\tresult code is $resultcode\n"; close(SCAN); + close(LOG); + exit 0; Index: autoconnect.pl =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/autoconnect.pl,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** autoconnect.pl 6 Jun 2006 18:31:26 -0000 1.11 --- autoconnect.pl 13 Jun 2006 20:44:06 -0000 1.12 *************** *** 0 **** --- 1,240 ---- + #!/opt/bin/microperl + + #use strict; + + $file = '/opt/connectlog0.txt'; # Log file + open(LOG, ">>$file"); # Open for appending + + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); + + #printf "%02d:%02d:%02d\n", + #$hour,$min,$sec; + + printf LOG "%02d:%02d:%02d ", $hour, $min, $sec; + print LOG "autoconnect.pl\n"; + + open(CHECKFORWLAN, "/sbin/ifconfig wlan0 2>&1 |") or die "Cannot run ifconfig wlan0 $!\n"; + + while(<CHECKFORWLAN>) { + if($_ =~ m/\berror\b/) { + print LOG "\tNo wlan0!\n"; + print LOG "\t$_\n"; + #open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5 6 7 |") or die "Cannot set LED $!\n"; + #sleep 1; + #open(LED, "/opt/bin/setLEDs |") or die "Cannot set LED $!\n"; + #sleep 1; + #open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5 6 7 |") or die "Cannot set LED $!\n"; + #sleep 1; + #open(LED, "/opt/bin/setLEDs |") or die "Cannot set LED $!\n"; + close(LOG); + exit; + } + } + + #open(LED, "/opt/bin/setLEDs 0 |") or die "Cannot set LED $!\n"; + + print LOG "\tTrying the various access points:\n"; + + for ($index = 0; $index < 16; $index++){ + open (RESULTS, "/sbin/wlanctl-ng wlan0 dot11req_scan_results bssindex=$index |") or die "Cannot open results: $!\n"; + while (<RESULTS>) { + chomp; + s/#.*//; + s/^\s+//; + s/\+$//; + next unless length; + my ($var, $value) = split(/\s*=\s*/, $_, 2); + $value =~ tr/'//d; + $Results[$index] {$var} = $value; + } + + close RESULTS; + + $ssid = $Results[$index]{ssid}; + $noise = $Results[$index]{noise} - 65400; + $signal = $Results[$index]{signal} - 65400; + $bssid = $Results[$index]{bssid}; + + $connect_success = 0; + + print LOG "\tbssid: $bssid ssid: $ssid\n"; + + if($ssid eq "no_value"){ + } else { + #open(LED, "/opt/bin/setLEDs|") or die "Cannot set LED $!\n"; + #sleep .2; + #open(LED, "/opt/bin/setLEDs 0|") or die "Cannot set LED $!\n"; + + open (CONNECT, "/sbin/wlanctl-ng wlan0 lnxreq_autojoin ssid=$ssid authtype=opensystem |") or die "Cannot open connect $!\n"; + + while (<CONNECT>) { + chomp; + s/#.*//; + s/^\s+//; + s/\+$//; + next unless length; + my ($var, $value) = split(/\s*=\s*/, $_, 2); + $value =~ tr/'//d; + $CONNECT_Result{$var} = $value; + # print LOG "\tvar $var is $value\n"; + } + + close CONNECT; + + open(PSAUX, "/bin/ps |") or die "Cannot run /bin/ps $!\n"; + while(<PSAUX>) { + if($_ =~ /wlan0/ && $_ =~ /udhcpc/){ + chomp; + @entry = split(' '); + $pid = $entry[0]; + print LOG "\tkilling udhcpc pid $pid\n"; + open (KILLUDHCPC, "/bin/kill $pid |") or die "Cannot kill udhcpc $!\n"; + } + } + + + sleep 1; + open (RENEW, "/sbin/udhcpc -nq -i wlan0|") or die "Cannot send renew signal to udhcpc $!\n"; + # open (RENEW, "/bin/kill -SIGUSR1 $pid |") or die "Cannot send renew signal to udhcpc $!\n"; + sleep 1; + + open(IPGRAB, "/opt/scripts/getIP.pl wlan0 |"); + while(<IPGRAB>){ + chomp; + $ip = $_; + } + + $pkts_sent = 0; + $pkts_rcvd = 0; + $max = 0; + + if($ip){ + print LOG "\tGot: $ip \n"; + + open (PING, "/bin/ping -c 4 128.2.211.159 |"); + + while (<PING>) { + # print "$_"; + if (/^(\d+) packets transmitted, (\d+) /) { + $pkts_sent = $1; + $pkts_rcvd = $2; + } + elsif (/(\d+\.?\d*)\/(\d+\.?\d*)\/(\d+\.?\d*)/) { #look for num/num/num + $min = $1; + $avg = $2; + $max = $3; + } + elsif (/^(\d+).*seq=(\d+).*ttl=(\d+).*time=(\d+\.?\d*) ms/) { + # look for packet size seq=NN and time=NN + $pkt_size[$pingI]=$1; + $seq[$pingI]=$2; + $ttl[$pingI]=$3; + $rtt[$pingI]=$4; + $pingI++; + } elsif (/^(\d+).*seq=(\d+).*ttl=(\d+).*time=(\d+\.?\d*) usec/) { + # look for packet size seq=NN and time=NN + $pkt_size[$pingI]=$1; + $seq[$pingI]=$2; + $ttl[$pingI]=$3; + $rtt[$pingI]=$4/1000; + $pingI++; + } + elsif( /^interval: (\d+\.?\d*)/ ) { + $interval = $1; + } + } + close (PING); + + print LOG "\tpackets sent: $pkts_sent packets received: $pkts_rcvd\n"; + print LOG "\tmax response time was: $max\n"; + } + + if($pkts_rcvd == 0){ + $Results[$index]{ping_success} = "bad "; + } else { + $Results[$index]{ping_success} = "good"; + } + + $Results[$index]{pkts_rcvd} = $pkts_rcvd; + } + } + + @ordered = sort { $b->{pkts_rcvd} <=> $a->{pkts_rcvd} || $b->{signal} <=> $a->{signal} } @Results; + + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); + + printf LOG "\n\t%02d:%02d:%02d ", $hour, $min, $sec; + print LOG "Results in order of preference: \n\n"; + + for $ref (@ordered){ + $ossid = $ref->{ssid}; + $obssid = $ref->{bssid}; + $opkts_rcvd = $ref->{pkts_rcvd}; + $osignal = $ref->{signal} - 65400; + $onoise = $ref->{noise} - 65400; + print LOG "\t$obssid $opkts_rcvd $osignal $onoise $ossid\n"; + } + + $best_ssid = $ordered[0]{ssid}; + + if($ordered[0]{ping_success} eq "good"){ + #open(LED, "/opt/bin/setLEDs 0 1 |") or die "Cannot set LED $!\n"; + + print LOG "\tConnecting to ssid: $best_ssid\n"; + + open (FINAL_CONNECT, "/sbin/wlanctl-ng wlan0 lnxreq_autojoin ssid=$best_ssid authtype=opensystem |") or die "Cannot open connect $!\n"; + + while (<FINAL_CONNECT>) { + chomp; + s/#.*//; + s/^\s+//; + s/\+$//; + next unless length; + my ($var, $value) = split(/\s*=\s*/, $_, 2); + $value =~ tr/'//d; + $FINAL_CONNECT_Result{$var} = $value; + # print "var $var is $value\n"; + } + + open(PSAUX, "/bin/ps |") or die "Cannot run /bin/ps $!\n"; + while(<PSAUX>) { + if($_ =~ /wlan0/ && $_ =~ /udhcpc/){ + chomp; + @entry = split(' '); + $pid = $entry[0]; + print LOG "\tkilling udhcpc pid $pid\n"; + open (KILLUDHCPC, "/bin/kill $pid |") or die "Cannot kill udhcpc $!\n"; + } + } + + if($FINAL_CONNECT_Result{resultcode} eq "success"){ + print LOG "\tSuccessfully connected\n"; + + #open(LED, "/opt/bin/setLEDs 0|") or die "Cannot set LED $!\n"; + #sleep .2; + #open(LED, "/opt/bin/setLEDs 0 1|") or die "Cannot set LED $!\n"; + #sleep .2; + #open(LED, "/opt/bin/setLEDs 0 1 2|") or die "Cannot set LED $!\n"; + #sleep .2; + #open(LED, "/opt/bin/setLEDs 0 1 2 3|") or die "Cannot set LED $!\n"; + #sleep .2; + #open(LED, "/opt/bin/setLEDs 0 1 2 3 4|") or die "Cannot set LED $!\n"; + #sleep .2; + #open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5|") or die "Cannot set LED $!\n"; + #sleep .2; + close(LOG); + exit 0; + } + } + + print LOG "\tNo valid networks\n"; + #open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5 6 7 |") or die "Cannot set LED $!\n"; + #sleep 1; + #open(LED, "/opt/bin/setLEDs |") or die "Cannot set LED $!\n"; + #sleep 1; + #open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5 6 7 |") or die "Cannot set LED $!\n"; + #sleep 1; + #open(LED, "/opt/bin/setLEDs |") or die "Cannot set LED $!\n"; + + close(LOG); + exit 0; Index: tryGateways.pl =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/tryGateways.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tryGateways.pl 6 Jun 2006 18:31:26 -0000 1.5 --- tryGateways.pl 13 Jun 2006 20:44:06 -0000 1.6 *************** *** 1,6 **** #!/opt/bin/microperl ! #$RELAY_IP = "128.2.211.159"; ! $RELAY_IP = "lion-o.terk.ri.cmu.edu"; open (ROUTES, "/bin/netstat -nr |") or die "Cannot netstat $!\n"; --- 1,13 ---- #!/opt/bin/microperl ! $file = '/opt/connectlog0.txt'; # Log file ! open(LOG, ">>$file"); # Open for appending ! ! ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); ! ! printf LOG "%02d:%02d:%02d ", $hour, $min, $sec; ! print LOG "tryGateways.pl\n"; ! ! $RELAY_IP = "128.2.211.159"; open (ROUTES, "/bin/netstat -nr |") or die "Cannot netstat $!\n"; *************** *** 10,14 **** ($Destination, $Gateway, $Genmask, $Flags, $MSS, $Window, $irtt, $Iface) = split(); if($Flags =~ m/UG/){ ! print "$Gateway is a gateway on $Iface\n"; $Gateways{$Iface} = $Gateway; $Interfaces{$Iface} = $Iface; --- 17,21 ---- ($Destination, $Gateway, $Genmask, $Flags, $MSS, $Window, $irtt, $Iface) = split(); if($Flags =~ m/UG/){ ! print LOG "\t$Gateway is a gateway on $Iface\n"; $Gateways{$Iface} = $Gateway; $Interfaces{$Iface} = $Iface; *************** *** 23,68 **** if($i > 1){ ! print "We have more than 1 default gateway.. in fact we have $i, and this may be a problem\n"; ($successes, $max_delay) = ping($RELAY_IP, 4); ! print "ping responded $successes times with a maximum delay of $max_delay\n"; if($successes > 0){ ! print "We had some successes pinging, yeah! Exiting\n"; $Interface = each(%Gateways); $CurrentInterface = $Interfaces{$Interface}; ! open(SETHOSTNAME, "/opt/scripts/setHostname.pl $CurrentInterface |") or die "Failed to set hostname $!\n"; while(<SETHOSTNAME>){ ! print $_; } exit 0; } else { ! print "We cannot ping our relay, turning off the routes\n"; while($Interface = each(%Gateways)){ $Gateway = $Gateways{$Interface}; ! open(DELROUTE, "/sbin/route del default gw $Gateway |") or die "Failed to delete route $!\n"; ! print "/sbin/route del default gw $Gateway\n"; } ! print "Turning on one route at a time\n"; while($Interface = each(%Gateways)){ $Gateway = $Gateways{$Interface}; open(ADDROUTE, "/sbin/route add default gw $Gateway |"); ! print "/sbin/route add default gw $Gateway\n"; ($individual_success, $dummy) = ping($RELAY_IP, 4); if($individual_success > 0){ $CurrentInterface = $Interfaces{$Interface}; ! print "successfully pinged with gateway $Gateway, setting hostname from $CurrentInterface then exiting\n"; open(SETHOSTNAME, "/opt/scripts/setHostname.pl $CurrentInterface |"); while(<SETHOSTNAME>){ ! print $_; } ! open(LED, "/opt/bin/setLEDs 0 |") or die "Cannot set LED $!\n"; ! sleep .2; ! open(LED, "/opt/bin/setLEDs 0 1|") or die "Cannot set LED $!\n"; ! ! exit 0; } else { ! print "failed to ping on $Gateway\n"; open(DELROUTE, "/sbin/route del default gw $Gateway |"); } --- 30,74 ---- if($i > 1){ ! print LOG "\tWe have more than 1 default gateway.. in fact we have $i, and this may be a problem\n"; ($successes, $max_delay) = ping($RELAY_IP, 4); ! print LOG "\tping responded $successes times with a maximum delay of $max_delay\n"; if($successes > 0){ ! print LOG "\tWe had some successes pinging, yeah! Exiting\n"; $Interface = each(%Gateways); $CurrentInterface = $Interfaces{$Interface}; ! open(SETHOSTNAME, "/opt/scripts/setHostname.pl $CurrentInterface |"); while(<SETHOSTNAME>){ ! print LOG $_; } + close(LOG); exit 0; } else { ! print LOG "\tWe cannot ping our relay, turning off the routes\n"; while($Interface = each(%Gateways)){ $Gateway = $Gateways{$Interface}; ! open(DELROUTE, "/sbin/route del default gw $Gateway |"); ! print LOG "\t/sbin/route del default gw $Gateway\n"; } ! print LOG "\tTurning on one route at a time\n"; while($Interface = each(%Gateways)){ $Gateway = $Gateways{$Interface}; open(ADDROUTE, "/sbin/route add default gw $Gateway |"); ! print LOG "\t/sbin/route add default gw $Gateway\n"; ($individual_success, $dummy) = ping($RELAY_IP, 4); if($individual_success > 0){ $CurrentInterface = $Interfaces{$Interface}; ! print LOG "\tsuccessfully pinged with gateway $Gateway, setting hostname from $CurrentInterface then exiting\n"; open(SETHOSTNAME, "/opt/scripts/setHostname.pl $CurrentInterface |"); while(<SETHOSTNAME>){ ! print LOG $_; } ! # open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5 6 7|") or die "Cannot set LED $!\n"; ! close(LOG); ! exit 0; } else { ! print LOG "\tfailed to ping on $Gateway\n"; open(DELROUTE, "/sbin/route del default gw $Gateway |"); } *************** *** 73,104 **** $CurrentInterface = $Interfaces{$Interface}; ! print "We have one default gateway, it's on $CurrentInterface, setting hostname from it.\n"; open(SETHOSTNAME, "/opt/scripts/setHostname.pl $CurrentInterface |"); while(<SETHOSTNAME>){ ! print $_; } ! open(LED, "/opt/bin/setLEDs 0 1 |") or die "Cannot set LED $!\n"; exit 0; } ! print "No gateways worked.\n"; ! ! open(LED, "/opt/bin/setLEDs 0 1 7|") or die "Cannot set LED $!\n"; #One ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 7|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 1 |") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 |") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 1 7|") or die "Cannot set LED $!\n"; #Two ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 7|") or die "Cannot set LED $!\n"; ! sleep 1; ! open(LED, "/opt/bin/setLEDs 0 |") or die "Cannot set LED $!\n"; ! sleep 1; ! ! open(RECONNECT, "/opt/scripts/reconnect.sh |") or die "Cannot run reconnect.sh $!\n"; ! exit 0; sub ping{ --- 79,94 ---- $CurrentInterface = $Interfaces{$Interface}; ! print LOG "\tWe have one default gateway, it's on $CurrentInterface, setting hostname from it.\n"; open(SETHOSTNAME, "/opt/scripts/setHostname.pl $CurrentInterface |"); while(<SETHOSTNAME>){ ! print LOG $_; } ! # open(LED, "/opt/bin/setLEDs 0 1 2 3 4 5 6 7|") or die "Cannot set LED $!\n"; ! close(LOG); exit 0; } ! print LOG "\tNo gateways worked.\n"; ! #open(LED, "/opt/bin/setLEDs|") or die "Cannot set LED $!\n"; sub ping{ *************** *** 109,113 **** while (<PING>) { ! # print "$_"; if (/^(\d+) packets transmitted, (\d+) /) { $pkts_sent = $1; --- 99,103 ---- while (<PING>) { ! # print LOG "$_"; if (/^(\d+) packets transmitted, (\d+) /) { $pkts_sent = $1; Index: getIP.pl =================================================================== RCS file: /cvsroot/terk/embed/src/scripts/getIP.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** getIP.pl 2 May 2006 18:43:09 -0000 1.3 --- getIP.pl 13 Jun 2006 20:44:06 -0000 1.4 *************** *** 1,4 **** --- 1,11 ---- #!/opt/bin/microperl + $file = '/opt/connectlog0.txt'; # Log file + open(LOG, ">>$file"); # Open for appending + + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); + + printf LOG "%02d:%02d:%02d ", $hour, $min, $sec; + print LOG "getIP.pl\n"; sub ifconfig2list() *************** *** 150,158 **** my($interfaceName) = shift; my(%interface) = %{$allInterfaces{$interfaceName}}; ! print "\n $interfaceName \n"; my($key,$value); ! print "\n\n[$interfaceName]======================================\n"; foreach $key (sort(keys(%interface))){ ! print "$key=" . $interface{$key} . "\n"; } } --- 157,165 ---- my($interfaceName) = shift; my(%interface) = %{$allInterfaces{$interfaceName}}; ! print LOG "\n\t $interfaceName \n"; my($key,$value); ! print LOG "\n\n\t[$interfaceName]======================================\n"; foreach $key (sort(keys(%interface))){ ! print LOG "\t$key=" . $interface{$key} . "\n"; } } *************** *** 177,181 **** if(@ARGV != 1){ ! print "Usage is getIP <adapter>\n"; exit; } --- 184,189 ---- if(@ARGV != 1){ ! print LOG "\tUsage is getIP <adapter>\n"; ! close(LOG); exit; } *************** *** 184,188 **** my(%interfaces) = parseIfconfig(@lines); ! print getKey(%interfaces, $ARGV[0], "a_inet") . "\n"; #print $1; --- 192,197 ---- my(%interfaces) = parseIfconfig(@lines); ! print LOG "\t"; ! print LOG getKey(%interfaces, $ARGV[0], "a_inet") . "\n"; #print $1; |