Skip to content

Commit

Permalink
Bug Fix
Browse files Browse the repository at this point in the history
Fixed a small type in networking
  • Loading branch information
NicK4rT committed Nov 18, 2024
1 parent d3096e6 commit 161a66d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Binary file modified software/.DS_Store
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion software/networking/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mysecrets = {"SSID": "Tufts_Robot", "key" : ""}
codes = {"0": b'PairingCodePhrase', "1": b'PairingResponsePhrase', "2": b'PairingConfirmationPhrase'}
configname = "Nickname"
configname = "Nickname"
config = ""
10 changes: 5 additions & 5 deletions software/networking/networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,16 +792,16 @@ def __handle_ack(sender_mac, subtype, stimestamp, rtimestamp, payload_type, payl
elif subtype == b'\x15': #Echo
self.master._iprint(f"Echo received from {sender_mac} ({self.peer_name(sender_mac)}), {__decode_payload(payload_type, payload)}")
elif subtype == b'\x11': #Success
payload = __decode_payload(payload_type, payload) # should return a list with a cmd type and payload
payload = __decode_payload(payload_type, payload) # should return a list with a cmd type and payload
self.master._iprint(f"Success received from {sender_mac} ({self.peer_name(sender_mac)}) for type {payload[0]} with payload {payload[1]}")
#add to ack buffer
elif subtype == b'\x12': #Fail
payload = __decode_payload(payload_type, payload) # should return a list with a cmd type, error and payload
self.master._iprint(f"Command fail received from {sender_mac} ({self.peer_name(sender_mac)}) for type {payload[0]} with error {payload[1]} and payload {payload[2]}")")
payload = __decode_payload(payload_type, payload) # should return a list with a cmd type, error and payload
self.master._iprint(f"Command fail received from {sender_mac} ({self.peer_name(sender_mac)}) for type {payload[0]} with error {payload[1]} and payload {payload[2]}")
#add to ack buffer
elif subtype == b'\x13': #Confirm
payload = __decode_payload(payload_type,payload) # should return a list with message type and payload
self.master._iprint(f"Receive confirmation received from {sender_mac} ({self.peer_name(sender_mac)}) for type {payload[0]} with payload {payload[1]}")")
payload = __decode_payload(payload_type,payload) # should return a list with message type and payload
self.master._iprint(f"Receive confirmation received from {sender_mac} ({self.peer_name(sender_mac)}) for type {payload[0]} with payload {payload[1]}")
#add to ack buffer
else:
self.master._iprint(f"Unknown ack subtype from {sender_mac} ({self.peer_name(sender_mac)}): {subtype}, Payload: {payload}")
Expand Down

0 comments on commit 161a66d

Please sign in to comment.