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
6f7dc38a
Commit
6f7dc38a
authored
2 years ago
by
Younus Salman
Browse files
Options
Downloads
Patches
Plain Diff
update wifi
parent
31068b49
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
iroha-drip-general-master/bluetooth/beacon.py
+4
-12
4 additions, 12 deletions
iroha-drip-general-master/bluetooth/beacon.py
iroha-drip-general-master/bluetooth/wifi_beacon.py
+3
-5
3 additions, 5 deletions
iroha-drip-general-master/bluetooth/wifi_beacon.py
with
7 additions
and
17 deletions
iroha-drip-general-master/bluetooth/beacon.py
+
4
−
12
View file @
6f7dc38a
...
...
@@ -22,7 +22,6 @@ from drippy.util import astm_float_to_int_hex, get_timestamp, astm_time
from
drippy.host_identity
import
HostIdentity
from
wifi_beacon
import
beacon_wifi
from
uuid
import
getnode
as
get_mac
# File with flight_id that will be incremented and used if no other
# flight_id is specified.
...
...
@@ -109,7 +108,7 @@ def location_update(gpsd: GpsPoller, iroha: DripIrohaAccount, flight_id):
)
if
is_wifi
:
beacon_wifi
(
mac_arr
,
payload
)
beacon_wifi
(
payload
)
else
:
# Set (Extended) Advertising command
if
is_bt5
:
...
...
@@ -140,7 +139,7 @@ def basic_id_update(hhit):
print
(
"
basic_id_update
"
)
# Set (Extended) Advertising Command
if
is_wifi
:
beacon_wifi
(
mac_arr
,
hhit
)
beacon_wifi
(
hhit
)
else
:
if
is_bt5
:
"""
...
...
@@ -171,10 +170,7 @@ def auth_update(auth_pages, msg_number):
for
page
in
auth_pages
:
msg
=
separate_bytes
(
hexlify
(
page
).
decode
(
"
utf-8
"
))
if
is_wifi
:
if
msg_number
==
1
:
beacon_wifi
(
mac_arr
,
msg
)
elif
msg_number
==
2
:
beacon_wifi
(
mac_arr
,
msg
)
beacon_wifi
(
msg
)
else
:
# Set (Extended) Advertising Command
if
is_bt5
:
...
...
@@ -224,7 +220,6 @@ def main():
global
is_bt5
global
is_wifi
global
mac_arr
parser
=
argparse
.
ArgumentParser
(
description
=
DESCRIPTION
)
parser
.
add_argument
(
...
...
@@ -384,10 +379,7 @@ def main():
Enable: 0x01 (True)
"""
subprocess
.
run
(
"
hcitool -i hci0 cmd 0x08 0x000a 01
"
,
shell
=
True
)
else
:
mac
=
hex
(
get_mac
())
# fetches device mac address
mac_arr
=
list
(
bytearray
.
fromhex
(
mac
[
2
:]))
# converts it into int
gpsd
=
None
if
not
args
.
run_scenario
and
args
.
gps
:
gpsd
=
GpsPoller
()
...
...
This diff is collapsed.
Click to expand it.
iroha-drip-general-master/bluetooth/wifi_beacon.py
+
3
−
5
View file @
6f7dc38a
...
...
@@ -22,9 +22,10 @@ if "wlan0" in addrs.keys():
elif
"
wlp2s0
"
in
addrs
.
keys
():
iface
=
'
wlp2s0
'
mac
=
hex
(
get_mac
())
# fetches device mac address
mac_address
=
list
(
bytearray
.
fromhex
(
mac
[
2
:]))
# converts it into int
def
beacon_wifi
(
mac_address
,
element_info
):
def
beacon_wifi
(
element_info
):
"""
Broadcasts a wifi beacon from mac_address with the SSID as the given element_info.
:param mac_address: A array of integer values representing the devices mac_address
...
...
@@ -64,9 +65,6 @@ def beacon_wifi(mac_address, element_info):
sendp
(
frame
,
iface
=
iface
,
inter
=
0.100
,
loop
=
1
)
# send the packet over interface iface every 100 milliseconds
mac
=
hex
(
get_mac
())
# fetches device mac address
mac_arr
=
list
(
bytearray
.
fromhex
(
mac
[
2
:]))
# converts it into int
#print(mac)
#print(mac_arr)
...
...
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