Skip to content

Commit

Permalink
pm3: attempt to detect BT dongle when udevadm is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed May 17, 2020
1 parent 11f0296 commit 6d1beb0
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions pm3
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,19 @@ function get_pm3_list_Linux {
if $FINDBTDONGLE; then
# check if the HC-06-USB white dongle is present (still, that doesn't tell us if it's paired with a Proxmark3...)
for DEV in $(find /dev/ttyUSB* 2>/dev/null); do
if udevadm info -q property -n "$DEV" | grep -q "ID_MODEL=CP2104_USB_to_UART_Bridge_Controller"; then
PM3LIST+=("$DEV")
if [ ${#PM3LIST[*]} -ge "$N" ]; then
return
if which udevadm >/dev/null; then
if udevadm info -q property -n "$DEV" | grep -q "ID_MODEL=CP2104_USB_to_UART_Bridge_Controller"; then
PM3LIST+=("$DEV")
if [ ${#PM3LIST[*]} -ge "$N" ]; then
return
fi
fi
else
if grep -q "DRIVER=cp210x" "/sys/class/tty/${DEV#/dev/}/../../uevent" 2>/dev/null; then
PM3LIST+=("$DEV")
if [ ${#PM3LIST[*]} -ge "$N" ]; then
return
fi
fi
fi
done
Expand Down

0 comments on commit 6d1beb0

Please sign in to comment.