Skip to content

Commit

Permalink
Add wrigley-diag.sh for LTE logging
Browse files Browse the repository at this point in the history
Enables port forwarding so that the LTE PC logger can talk to the LTE
card through the T20.

Change-Id: Id4ea9b0057c22a1e1f4193e1bb8e91dab8ca45ff
  • Loading branch information
John Michelau authored and Wink Saville committed Apr 6, 2011
1 parent f0b17bf commit 452c4fe
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions device.mk
Expand Up @@ -18,6 +18,7 @@ $(call inherit-product, device/moto/wingray/device_base.mk)

PRODUCT_COPY_FILES += \
device/moto/stingray/ril/tty2ttyd:system/bin/tty2ttyd \
device/moto/stingray/ril/wrigley-diag.sh:system/bin/wrigley-diag.sh \
device/moto/stingray/apns-conf.xml:system/etc/apns-conf.xml

ifneq ($(AP_RIL_BLDSRC),1)
Expand Down
24 changes: 24 additions & 0 deletions ril/wrigley-diag.sh
@@ -0,0 +1,24 @@
#!/system/bin/sh

isBlanFound=0

for iface in `ls /sys/class/net` ; do
desc=`cat /sys/class/net/$iface/description`
case $desc in
"Motorola BLAN Interface")
echo "Found Motorola BLAN at $iface"
echo "Forwarding ports for Wrigley diagnostics"
echo 1 > /proc/sys/net/ipv4/ip_forward;
/system/bin/iptables -t nat -A PREROUTING -p tcp -i $iface -d 192.168.16.2 --dport 11006 -j DNAT --to 192.168.20.2:11006;
/system/bin/iptables -A FORWARD -p tcp -i $iface -d 192.168.20.2 --dport 11006 -j ACCEPT;
isBlanFound=1;
break
;;
*)
echo "$iface is not the Motorola BLAN";
continue
;;
esac
done

case $isBlanFound in 0) echo "Could not find Motorola BLAN";; esac

0 comments on commit 452c4fe

Please sign in to comment.