inline broadcast address

This commit is contained in:
Maxime Bloch 2020-01-22 19:50:57 +01:00
parent 1c8bcd2182
commit d054a4093e
No known key found for this signature in database
GPG key ID: CE32A7D95B7D6418
3 changed files with 3 additions and 5 deletions

View file

@ -1,7 +1,7 @@
import datetime
import socket
from utils import mac_address, broadcast_address
from utils import mac_address
if __name__ == "__main__":
@ -14,7 +14,7 @@ if __name__ == "__main__":
destination = byte_string[0:6]
if byte_string[12:14] == b"\x60\x00" \
and (destination == mac_address or destination == broadcast_address):
and (destination == mac_address or destination == b'\xff\xff\xff\xff\xff\xff'):
source = byte_string[6:12]
message = byte_string[14:].decode("utf-8").rstrip("\x00")

View file

@ -9,7 +9,7 @@ if __name__ == "__main__":
sock.bind((utils.get_device_name(), 0))
frame = utils.broadcast_address + utils.mac_address + b"\x60\x00" + "ZeusWPI is de max!".encode()
frame = b'\xff\xff\xff\xff\xff\xff' + utils.mac_address + b"\x60\x00" + "ZeusWPI is de max!".encode()
while True:
dt_string = datetime.datetime.now().strftime("%d/%m/%Y %H:%M:%S")

View file

@ -18,5 +18,3 @@ def get_mac_address() -> bytes:
mac_address = get_mac_address()
broadcast_address = b'\xff\xff\xff\xff\xff\xff'