Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: shellcheck
on: [push, pull_request]
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
6 changes: 3 additions & 3 deletions scripts/reset_ble_stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
set -e

systemctl --user stop ble-peripheral
bluetoothctl power off &> /dev/null
bluetoothctl power off > /dev/null 2>&1
echo "Restarting bluez"
# Configure sudo to allow running this without asking for a password
sudo $(realpath scripts/reset_bluez.sh)
sudo "$(realpath scripts/reset_bluez.sh)"
sleep 2
echo "Powering on controller"
bluetoothctl power on &> /dev/null
bluetoothctl power on > /dev/null 2>&1
sleep 2
echo "Starting BLE service"
systemctl --user start ble-peripheral
Expand Down
4 changes: 2 additions & 2 deletions scripts/reset_manually.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#!/usr/bin/env bash

notify-send -t 3600000 -a ProtocolStateFuzzer -h string:x-canonical-private-synchronous:my-notification ProtocolStateFuzzer 'Device reset needed'
read -p 'PLEASE RESET THE DEVICE AND THEN PRESS ENTER TO CONTINUE...'
read -r -p 'PLEASE RESET THE DEVICE AND THEN PRESS ENTER TO CONTINUE...'
notify-send -t 1 -a ProtocolStateFuzzer -h string:x-canonical-private-synchronous:my-notification ProtocolStateFuzzer 'Continuing'

8 changes: 5 additions & 3 deletions scripts/setup_venv.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
#!/bin/bash
#!/usr/bin/env bash

# This script sets up the python environment if it doesn't exist yet.
# It should be sourced (i.e. called with "source scripts/setup_venv.sh")
# so that the python environment will be available in the calling shell.

if [ -d "venv" ]; then
# shellcheck source=/dev/null
source venv/bin/activate
else
# Create a venv and activate it
python3 -m venv venv
# shellcheck source=/dev/null
source venv/bin/activate
# Install dependencies from PyPi
pip3 install -r requirements.txt
# Install the BLESMPServer
git clone https://github.com/apferscher/ble-learning.git
cd ble-learning
cd ble-learning || exit
git checkout febd774109c41a6635659b8847cc766e667841dd
cd libs/smp_server
cd libs/smp_server || exit
python3 setup.py install
cd ../../..
rm -rf ble-learning
Expand Down