Added more functionality

Added previously connected Switch finding

Cleaned up demo CLI command

Added ability to stop  macros

Fixed reconnecting and timing quirks

Bugfixes and polish
This commit is contained in:
Brikwerk 2020-08-01 23:11:47 -07:00
commit 7e99a36675
10 changed files with 745 additions and 182 deletions

View file

@ -3,6 +3,10 @@ This is a quick and dirty script for recording input from a controller
and dumping it into a "messages.txt" file. You'll need to input the
device's Bluetooth MAC address manually and specify the type of
controller before this script works.
Note: If you get an Invalid Exchange error when running this script, this means
that the Switch has paired to the controller, invalidating the original pairing
key we created. You'll need to remove the controller before continuing.
"""
import socket
@ -93,7 +97,7 @@ def write_to_buffer(buffer, message, message_type):
if __name__ == "__main__":
# Switch Controller Bluetooth MAC Address goes here
jc_MAC = "7C:BB:8A:FA:41:3D"
jc_MAC = "98:B6:E9:B0:05:E7"
# Specify the type of controller here
controller_type = PRO_CONTROLLER
if controller_type == JOYCON_L:
@ -203,11 +207,11 @@ if __name__ == "__main__":
jc_itr.sendall(reply)
# Sending Switch the proxy's device info
if controller_type == ControllerTypes.JOYCON_R:
if controller_type == JOYCON_R:
client_interrupt.sendall(REPLY)
elif controller_type == ControllerTypes.JOYCON_L:
elif controller_type == JOYCON_L:
client_interrupt.sendall(REPLY)
elif controller_type == ControllerTypes.PRO_CONTROLLER:
elif controller_type == PRO_CONTROLLER:
client_interrupt.sendall(REPLY)
# Waste some cycles here until we get the controllers info.