Пример #1
0
def start_hidd(bdaddr=None, ipaddr="127.0.0.1"):
    devices = [ 'PLAYSTATION(R)3 Controller',
                'BD Remote Control' ]
    hid = HID(bdaddr)
    watch = None
    if sixwatch:
        try:
            print("Starting USB sixwatch")
            watch = SixWatch(hid.get_local_address())
        except Exception as e:
            print("Failed to initialize sixwatch" + str(e))
            pass

    while True:
        if hid.listen():
            (csock, addr) = hid.get_control_socket()
            device_name = bt_lookup_name(addr[0])
            if device_name == devices[0]:
                # handle PS3 controller
                handle_ps3_controller(hid, ipaddr)
            elif device_name == devices[1]:
                # handle the PS3 remote
                handle_ps3_remote(hid, ipaddr)
            else:
                print("Unknown Device: %s" % (device_name))
Пример #2
0
def start_hidd(bdaddr=None, ipaddr="127.0.0.1"):
    devices = ['PLAYSTATION(R)3 Controller', 'BD Remote Control']
    hid = HID(bdaddr)
    watch = None
    if sixwatch:
        try:
            print "Starting USB sixwatch"
            watch = SixWatch(hid.get_local_address())
        except Exception, e:
            print "Failed to initialize sixwatch" + str(e)
            pass
Пример #3
0
def start_hidd(bdaddr=None, ipaddr="127.0.0.1"):
    devices = [ 'PLAYSTATION(R)3 Controller',
                'BD Remote Control' ]
    hid = HID(bdaddr)
    watch = None
    if sixwatch:
        try:
            print "Starting USB sixwatch"
            watch = SixWatch(hid.get_local_address())
        except Exception, e:
            print "Failed to initialize sixwatch" + str(e)
            pass
Пример #4
0
def start_hidd(bdaddr=None, ipaddr="127.0.0.1"):
    devices = ['PLAYSTATION(R)3 Controller', 'BD Remote Control']
    hid = HID(bdaddr)
    while True:
        if hid.listen():
            (csock, addr) = hid.get_control_socket()
            device_name = bt_lookup_name(addr[0])
            if device_name == devices[0]:
                # handle PS3 controller
                handle_ps3_controller(hid, ipaddr)
            elif device_name == devices[1]:
                # handle the PS3 remote
                handle_ps3_remote(hid, ipaddr)
            else:
                print "Unknown Device: %s" % (device_name)
Пример #5
0
def start_hidd(bdaddr=None, ipaddr="127.0.0.1"):
    devices = [ 'PLAYSTATION(R)3 Controller',
                'BD Remote Control' ]
    hid = HID(bdaddr)
    while True:
        if hid.listen():
            (csock, addr) = hid.get_control_socket()
            device_name = bt_lookup_name(addr[0])
            if device_name == devices[0]:
                # handle PS3 controller
                handle_ps3_controller(hid, ipaddr)
            elif device_name == devices[1]:
                # handle the PS3 remote
                handle_ps3_remote(hid, ipaddr)
            else:
                print "Unknown Device: %s" % (device_name)
Пример #6
0
def start_hidd(bdaddr=None, ipaddr="127.0.0.1"):
    devices = ['PLAYSTATION(R)3 Controller', 'BD Remote Control']
    hid = HID(bdaddr)
    watch = None
    if sixwatch:
        try:
            print("Starting USB sixwatch")
            watch = SixWatch(hid.get_local_address())
        except Exception as e:
            print("Failed to initialize sixwatch" + str(e))
            pass

    while True:
        if hid.listen():
            (csock, addr) = hid.get_control_socket()
            device_name = bt_lookup_name(addr[0])
            if device_name == devices[0]:
                # handle PS3 controller
                handle_ps3_controller(hid, ipaddr)
            elif device_name == devices[1]:
                # handle the PS3 remote
                handle_ps3_remote(hid, ipaddr)
            else:
                print("Unknown Device: %s" % (device_name))