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
Commits
f77dd4ea
Commit
f77dd4ea
authored
2 years ago
by
Abdullah Bin Zubair
Browse files
Options
Downloads
Patches
Plain Diff
Updated beacon_1 is the updated beacon code
parent
b9d9dd7d
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_1.py
+7
-7
7 additions, 7 deletions
iroha-drip-general-master/bluetooth/beacon_1.py
with
7 additions
and
7 deletions
iroha-drip-general-master/bluetooth/beacon_1.py
+
7
−
7
View file @
f77dd4ea
...
...
@@ -79,8 +79,8 @@ def get_auth_pages(signature: bytes, auth_type=0x10):
return
auth_pages
def
location_update
(
gpsd
:
GpsPoller
,
iroha
:
DripIrohaAccount
,
flight_id
):
# Placing a single location message For Now
def
Drip_Wrapper
(
gpsd
:
GpsPoller
,
iroha
:
DripIrohaAccount
,
flight_id
):
# ASTM F3-411 Location message 0x1
print
(
"
location_update
"
)
global
executor
...
...
@@ -136,7 +136,7 @@ def location_update(gpsd: GpsPoller, iroha: DripIrohaAccount, flight_id):
"
hcitool -i hci0 cmd 0x08 0x0008 1f 1e 16 fa ff 0d 00 10 {payload}
"
.
format
(
payload
=
payload
),
shell
=
True
)
def
manifest_broadcast
(
payload
,
flight_id
):
def
manifest_broadcast
(
payload
,
flight_id
):
## Manifest broadcast can contain max 11 hashes (at 8-bytes each). For now we are sending one message.
# ASTM F3-411 Location message 0x1
print
(
"
manifest_broadcast
"
)
...
...
@@ -169,7 +169,7 @@ def manifest_broadcast(payload, flight_id):
Advertising_Data: 1e 16 fa ff 0d 00 10 + payload
"""
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x0037 0x00 0x03 0x01 0x1f 0x1e 0x16 0xfa 0xff 0x0d 0x00 0x10 {payload}
"
.
format
(
payload
=
hash_payload
),
shell
=
True
)
"
hcitool -i hci0 cmd 0x08 0x0037 0x00 0x03 0x01 0x1f 0x1e 0x16 0xfa 0xff 0x0d 0x00 0x10 {payload}
"
.
format
(
payload
=
hash_payload
),
shell
=
True
)
#0x03
else
:
"""
OGF: 0x08 (LE controller commands)
...
...
@@ -377,7 +377,7 @@ def main():
# but just for now, we are generating the r_signature using the same function used for drone signature generate function
attest
=
hi
.
generate_self_concise_attestation
(
get_timestamp
(
exp_date
))
attest
=
hi
.
generate_self_concise_attestation
(
r_hhit
,
r_signature
,
get_timestamp
(
exp_date
))
if
attest
is
None
:
print
(
"
Expiration date has expired.
"
)
sys
.
exit
(
-
1
)
...
...
@@ -470,8 +470,8 @@ def main():
auth_update
(
auth_pages
[
2
:],
2
)
# Location updates at least once every second.
location_update
(
gpsd
,
iroha
,
flight_id
)
Drip_Wrapper
(
gpsd
,
iroha
,
flight_id
)
# Manifest broadcast
manifest_broadcast
(
payload
,
flight_id
)
if
args
.
run_scenario
:
g_lat
+=
random
.
uniform
(
0.0001
,
0.001
)
*
\
...
...
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