Skip to content
Snippets Groups Projects
Commit a01e110d authored by Hampus Rosenquist's avatar Hampus Rosenquist
Browse files

Minor adjustments to hci commands in beacon.py

parent b70b7b0b
No related branches found
No related tags found
No related merge requests found
...@@ -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 03 01 1f 1e 16 fa ff 0d 00 10 {payload}".format(payload=payload), shell=True) "hcitool -i hci0 cmd 0x08 0x0037 0x00 0x03 0x01 0x1f 0x1e 0x16 0xfa 0xff 0x0d 0x00 0x10 {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 01 1f 1e 16 fa ff 0d 00 00 42 {} 00 00 00 00 00 00 00".format(hhit), shell=True) "hcitool -i hci0 cmd 0x08 0x0037 0x00 0x03 0x01 0x1f 0x1e 0x16 0xfa 0xff 0x0d 0x00 0x00 0x42 {} 0x00 0x00 0x00 0x00 0x00 0x00 0x00".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: 0x03 (Complete extended advertising data) Operation: 0x01 / 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 01 1f 1e 16 fa ff 0d {} 20 {}".format("00", msg), shell=True) "hcitool -i hci0 cmd 0x08 0x0037 0x00 0x01 0x01 0x1f 0x1e 0x16 0xfa 0xff 0x0d {} 0x20 {}".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 01 1f 1e 16 fa ff 0d {} 20 {}".format("00", msg), shell=True) "hcitool -i hci0 cmd 0x08 0x0037 0x00 0x02 0x01 0x1f 0x1e 0x16 0xfa 0xff 0x0d {} 0x20 {}".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 07 00 01 e0 00 01 e0 07 00 00 00 00 00 00 00 00 02 7f 03 00 03 00 00", shell=True) "hcitool -i hci0 cmd 0x08 0x0036 0x00 0x0000 0x0001e0 0x0001e0 0x07 0x00 0x00 0x000000000000 0x02 0x7f 0x03 0x00 0x03 0x00 0x00", 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 01 00 00 00 00", shell=True) subprocess.run("hcitool -i hci0 cmd 0x08 0x0039 0x01 0x01 0x00 0x0000 0x00", shell=True)
else: else:
""" """
OGF: 0x08 (LE controller commands) OGF: 0x08 (LE controller commands)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment