Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TDDE21 DRIP 2023
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
Viktor Norgren
TDDE21 DRIP 2023
Commits
a01e110d
Commit
a01e110d
authored
2 years ago
by
Hampus Rosenquist
Browse files
Options
Downloads
Patches
Plain Diff
Minor adjustments to hci commands in beacon.py
parent
b70b7b0b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iroha-drip-general-master/bluetooth/beacon.py
+7
-7
7 additions, 7 deletions
iroha-drip-general-master/bluetooth/beacon.py
with
7 additions
and
7 deletions
iroha-drip-general-master/bluetooth/beacon.py
+
7
−
7
View file @
a01e110d
...
@@ -117,7 +117,7 @@ def location_update(gpsd: GpsPoller, iroha: DripIrohaAccount, flight_id):
...
@@ -117,7 +117,7 @@ def location_update(gpsd: GpsPoller, iroha: DripIrohaAccount, flight_id):
Advertising_Data: 1e 16 fa ff 0d 00 10 + payload
Advertising_Data: 1e 16 fa ff 0d 00 10 + payload
"""
"""
subprocess
.
run
(
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x0037 00 0
3
01 1f 1e 16 fa ff 0
d
00 10 {payload}
"
.
format
(
payload
=
payload
),
shell
=
True
)
"
hcitool -i hci0 cmd 0x08 0x0037
0x
00 0
x03 0x
01
0x
1f
0x
1e
0x
16
0x
fa
0x
ff 0
x0d 0x
00
0x
10 {payload}
"
.
format
(
payload
=
payload
),
shell
=
True
)
else
:
else
:
"""
"""
OGF: 0x08 (LE controller commands)
OGF: 0x08 (LE controller commands)
...
@@ -144,7 +144,7 @@ def basic_id_update(hhit):
...
@@ -144,7 +144,7 @@ def basic_id_update(hhit):
Advertising_Data: 1e 16 fa ff 0d 00 10 + hhit
Advertising_Data: 1e 16 fa ff 0d 00 10 + hhit
"""
"""
subprocess
.
run
(
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x0037 00 03 0
1
1f 1e 16 fa ff 0d 0
0
00 42 {} 00 00 0
0
00 00 0
0
00
"
.
format
(
hhit
),
shell
=
True
)
"
hcitool -i hci0 cmd 0x08 0x0037
0x
00
0x
03 0
x01 0x
1f
0x
1e
0x
16
0x
fa
0x
ff
0x
0d 0
x00 0x
00
0x
42 {}
0x
00
0x
00 0
x00 0x
00
0x
00 0
x00 0x
00
"
.
format
(
hhit
),
shell
=
True
)
else
:
else
:
"""
"""
OGF: 0x08 (LE controller commands)
OGF: 0x08 (LE controller commands)
...
@@ -167,17 +167,17 @@ def auth_update(auth_pages, msg_number):
...
@@ -167,17 +167,17 @@ def auth_update(auth_pages, msg_number):
OGF: 0x08 (LE controller commands)
OGF: 0x08 (LE controller commands)
OCF: 0x0037 (LE Set Extended Advertising Data command)
OCF: 0x0037 (LE Set Extended Advertising Data command)
Advertising handle: 0x00 (Advertising set number)
Advertising handle: 0x00 (Advertising set number)
Operation: 0x0
3 (Complete extended
advertising data)
Operation: 0x0
1 / 0x02 (First and last part of
advertising data)
Fragment_Preference: 0x01 (The Controller should not fragment or should minimize fragmentation of Host advertising data)
Fragment_Preference: 0x01 (The Controller should not fragment or should minimize fragmentation of Host advertising data)
Advertising_Data_Length: 0x1f
Advertising_Data_Length: 0x1f
Advertising_Data: 1e 16 fa ff 0d 00 20 + msg
Advertising_Data: 1e 16 fa ff 0d 00 20 + msg
"""
"""
if
msg_number
==
1
:
if
msg_number
==
1
:
subprocess
.
run
(
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x0037 00 01 0
1
1f 1e 16 fa ff 0d {} 20 {}
"
.
format
(
"
00
"
,
msg
),
shell
=
True
)
"
hcitool -i hci0 cmd 0x08 0x0037
0x
00
0x
01 0
x01 0x
1f
0x
1e
0x
16
0x
fa
0x
ff
0x
0d {}
0x
20 {}
"
.
format
(
"
00
"
,
msg
),
shell
=
True
)
elif
msg_number
==
2
:
elif
msg_number
==
2
:
subprocess
.
run
(
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x0037 00 02 0
1
1f 1e 16 fa ff 0d {} 20 {}
"
.
format
(
"
00
"
,
msg
),
shell
=
True
)
"
hcitool -i hci0 cmd 0x08 0x0037
0x
00
0x
02 0
x01 0x
1f
0x
1e
0x
16
0x
fa
0x
ff
0x
0d {}
0x
20 {}
"
.
format
(
"
00
"
,
msg
),
shell
=
True
)
else
:
else
:
"""
"""
OGF: 0x08 (LE controller commands)
OGF: 0x08 (LE controller commands)
...
@@ -321,7 +321,7 @@ def main():
...
@@ -321,7 +321,7 @@ def main():
Scan_Request_Notification_Enable: 0x00 (Scan request notifications disabled)
Scan_Request_Notification_Enable: 0x00 (Scan request notifications disabled)
"""
"""
subprocess
.
run
(
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x0036 00
00 0
7
00
01
e0 00
01
e0 0
7
00 00 00
00
00
00
00
00 02 7f 03 00 0
3
00 00
"
,
shell
=
True
)
"
hcitool -i hci0 cmd 0x08 0x0036 0
x00 0x0
000 0
x
0001e0 0
x0
001e0 0
x07 0x
00
0x
00 0
x
0000000
0
0000
0x
02
0x
7f
0x
03
0x
00 0
x03 0x
00
0x
00
"
,
shell
=
True
)
else
:
else
:
"""
"""
OGF: 0x08 (LE controller commands)
OGF: 0x08 (LE controller commands)
...
@@ -349,7 +349,7 @@ def main():
...
@@ -349,7 +349,7 @@ def main():
Duration[i]: 0x0000 (Advertise until the Host disables it)
Duration[i]: 0x0000 (Advertise until the Host disables it)
Max_Extended_Advertising_Events[i]: 0x00 (No maximum)
Max_Extended_Advertising_Events[i]: 0x00 (No maximum)
"""
"""
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x0039 01 0
1
00 00
00 00
"
,
shell
=
True
)
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x0039
0x
01 0
x01 0x
00 0
x0
000
0x
00
"
,
shell
=
True
)
else
:
else
:
"""
"""
OGF: 0x08 (LE controller commands)
OGF: 0x08 (LE controller commands)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment