Skip to content

Commit db50a15

Browse files
committed
version update
1 parent 6927537 commit db50a15

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

podcomm/definitions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@
1717
OMNIPY_LOGGER = "OMNIPY"
1818
OMNIPY_LOGFILE = "omnipy"
1919

20-
2120
OMNIPY_PACKET_LOGGER = "OMNIPACKET"
2221
OMNIPY_PACKET_LOGFILE = "packet"
2322

23+
OMNIPY_DATABASE = "omni.db"
24+
2425
API_VERSION_MAJOR = 1
2526
API_VERSION_MINOR = 3
26-
API_VERSION_REVISION = 5
27-
API_VERSION_BUILD = 19163
27+
API_VERSION_REVISION = 6
28+
API_VERSION_BUILD = 19170
2829

2930
REST_URL_PING = "/omnipy/ping"
3031
REST_URL_OMNIPY_SHUTDOWN = "/omnipy/shutdown"

scripts/bt-nap.sh

100644100755
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
11
#!/usr/bin/env bash
22

33
pair_bt_device() {
4+
echo "Enabling bluetooth discovery"
45
sudo btmgmt power off
56
sudo btmgmt ssp on
67
sudo btmgmt connectable on
78
sudo btmgmt pairable on
89
sudo btmgmt discov on
910
sudo btmgmt power on
10-
bt_device=
11-
while [[ -z "${bt_device}" ]]
12-
do
13-
sleep 1
14-
bt_device=`sudo bt-device -l | grep -e \(.*\)`
11+
echo "Waiting for a connection"
12+
while : ; do
13+
sleep 2
14+
sudo bt-device -l > /dev/null 2>&1
15+
[[ ! $? -eq 0 ]] || break
1516
done
1617

18+
echo "Pairing completed"
1719
sudo btmgmt discov off
18-
echo "Paired with ${bt_device}"
20+
sleep 15
1921
}
2022

2123
while true;
2224
do
23-
killall -9 bt-network > /dev/null 2>&1
2425
sudo btmgmt power off
2526
sudo btmgmt power on
2627
paired_devices=`bt-device -l | grep -e \(.*\) --color=never -o| cut -d'(' -f2 | cut -d')' -f1`
27-
if [[ ! -z ${paired_devices} ]]; then
28+
if [[ ! -z "${paired_devices}" ]]; then
2829
while read -r mac_address;
2930
do
30-
/usr/bin/bt-network -c ${mac_address} nap > /dev/null 2>&1
31+
echo "Connecting to ${mac_address}"
32+
killall -9 bt-network > /dev/null 2>&1
33+
/usr/bin/bt-network -c ${mac_address} nap
34+
echo "Disconnected from ${mac_address} (or connection failed)"
3135
done <<< "${paired_devices}"
3236
sleep 15
3337
else

0 commit comments

Comments
 (0)