Skip to content

Commit

Permalink
Make bluetooth_obex_send job able to run on both classic and core (Bu…
Browse files Browse the repository at this point in the history
…gFix) (#1172)

Replace `l2ping` command with `hcitool inq` because l2ping is not a part of the bluez snap.
  • Loading branch information
rickwu666666 authored Apr 12, 2024
1 parent de07b8b commit 803cfe4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions providers/base/units/bluetooth/jobs.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,10 @@ category_id: com.canonical.plainbox::bluetooth
id: bluetooth/bluetooth_obex_send
depends: bluetooth/detect-output
estimated_duration: 10.0
environ: BTDEVADDR PLAINBOX_PROVIDER_DATA
requires:
package.name == 'bluez'
executable.name == 'obexftp'
package.name == 'bluez' or snap.name == 'bluez'
executable.name == 'obexftp' and executable.name == 'hcitool'
device.category == 'BLUETOOTH'
command:
if [ -z "$BTDEVADDR" ]
Expand All @@ -436,7 +437,7 @@ command:
for bt in $(echo "${BTDEVADDR}" | cut -d = -f 2 | sed s/,/\\n/g)
do
echo "Host:[${bt}]"
if echo 'u' | sudo -S l2ping -c 5 -t 5 "${bt}"
if hcitool inq | grep -q "${bt}"
then
echo "Get available BTDEVADDR:[${bt}]"
set -o pipefail
Expand Down

0 comments on commit 803cfe4

Please sign in to comment.