Skip to content
Snippets Groups Projects
Commit f77dd4ea authored by Abdullah Bin Zubair's avatar Abdullah Bin Zubair
Browse files

Updated beacon_1 is the updated beacon code

parent b9d9dd7d
No related branches found
No related tags found
No related merge requests found
......@@ -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) * \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment