Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TDDE21 DRIP 2022
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hampus Rosenquist
TDDE21 DRIP 2022
Merge requests
!1
Fixes and improvements to bt and drippy scripts
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fixes and improvements to bt and drippy scripts
elmzi904/gps_poll_update
into
main
Overview
0
Commits
1
Pipelines
0
Changes
4
Merged
Elmedin Zildzic
requested to merge
elmzi904/gps_poll_update
into
main
1 year ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Fix bs4 constructor args, now uses xml
Add verbosity option for hcitool commands
Output errors
Implement graceful shutdown for GpsPoller
GpsPoller now opens UNIX socket instead of using GPS lib
Edited
1 year ago
by
Elmedin Zildzic
0
0
Merge request reports
Compare
version 1
version 1
8a740916
1 year ago
main (base)
and
latest version
latest version
139b0ea6
1 commit,
1 year ago
version 1
8a740916
1 commit,
1 year ago
Show latest version
1 file
+
6
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
iroha-drip-general-master/bluetooth/beacon.py
+
6
−
6
Options
@@ -284,7 +284,7 @@ def main():
dest
=
"
verbose
"
,
default
=
False
,
action
=
"
store_true
"
,
help
=
"
Specify verbosity level
.
"
help
=
"
Use verbose output
.
"
)
args
=
parser
.
parse_args
(
sys
.
argv
[
1
:])
@@ -336,7 +336,7 @@ def main():
if
not
is_wifi
:
# Reset bt
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x03 0x0003
"
,
shell
=
True
)
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x03 0x0003
"
,
shell
=
True
,
stdout
=
stdout_fd
,
stderr
=
subprocess
.
STDOUT
)
# Set (Extended) Advertising Parameters
if
is_bt5
:
@@ -360,7 +360,7 @@ def main():
Scan_Request_Notification_Enable: 0x00 (Scan request notifications disabled)
"""
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x0036 0x00 0x00 0x00 0xa0 0x00 0x00 0xa0 0x00 0x00 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x02 0x7f 0x03 0x00 0x03 0x00 0x00
"
,
shell
=
True
)
"
hcitool -i hci0 cmd 0x08 0x0036 0x00 0x00 0x00 0xa0 0x00 0x00 0xa0 0x00 0x00 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x02 0x7f 0x03 0x00 0x03 0x00 0x00
"
,
shell
=
True
,
stdout
=
stdout_fd
,
stderr
=
subprocess
.
STDOUT
)
else
:
"""
OGF: 0x08 (LE controller commands)
@@ -375,7 +375,7 @@ def main():
Advertising_Filter_Policy: 0x02 (Process scan requests: all devices, Connection requests: only Filter Accept List)
"""
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x0006 a0 00 a0 00 03 00 00 00 00 00 00 00 00 07 02
"
,
shell
=
True
)
"
hcitool -i hci0 cmd 0x08 0x0006 a0 00 a0 00 03 00 00 00 00 00 00 00 00 07 02
"
,
shell
=
True
,
stdout
=
stdout_fd
,
stderr
=
subprocess
.
STDOUT
)
# Enable (Extended) Bluetooth Advertisement
if
is_bt5
:
@@ -388,14 +388,14 @@ def main():
Duration[i]: 0x0000 (Advertise until the Host disables it)
Max_Extended_Advertising_Events[i]: 0x00 (No maximum)
"""
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x0039 0x01 0x01 0x00 0x00 0x00 0x00
"
,
shell
=
True
,
stdout
=
s
ubprocess
.
DEVNULL
,
stderr
=
subprocess
.
DEVNULL
)
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x0039 0x01 0x01 0x00 0x00 0x00 0x00
"
,
shell
=
True
,
stdout
=
s
tdout_fd
,
stderr
=
subprocess
.
STDOUT
)
else
:
"""
OGF: 0x08 (LE controller commands)
OCF: 0x000a (LE Set Advertising Enable command)
Enable: 0x01 (True)
"""
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x000a 01
"
,
shell
=
True
,
stdout
=
s
ubprocess
.
DEVNULL
,
stderr
=
subprocess
.
DEVNULL
)
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x000a 01
"
,
shell
=
True
,
stdout
=
s
tdout_fd
,
stderr
=
subprocess
.
STDOUT
)
gpsd
=
None
if
not
args
.
run_scenario
and
args
.
gps
:
Loading