How to use the openweave.WeaveDeviceMgr.TargetDeviceId_Any function in openweave

To help you get started, we’ve selected a few openweave examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openweave / openweave-core / src / test-apps / happy / lib / WeaveDeviceManager.py View on Github external
devMgr.Close()
        devMgr.CloseEndpoints()
    except WeaveDeviceMgr.DeviceManagerException, ex:
        print str(ex)
        exit()

    print ''
    print '#################################rendezvous2#################################'
    try:
        devMgr.RendezvousDevice(
                                pairingCode=options.pairingCode,
                                targetFabricId=WeaveDeviceMgr.TargetFabricId_AnyFabric,
                                targetModes=WeaveDeviceMgr.TargetDeviceMode_Any,
                                targetVendorId=WeaveDeviceMgr.TargetVendorId_Any,
                                targetProductId=WeaveDeviceMgr.TargetProductId_Any,
                                targetDeviceId=WeaveDeviceMgr.TargetDeviceId_Any)
    except WeaveDeviceMgr.DeviceManagerException, ex:
        print str(ex)
        exit()

    print "Connected to device %X at %s" % (nodeId, addr)

    print ''
    print '#################################close#################################'

    try:
        devMgr.Close()
        devMgr.CloseEndpoints()
    except WeaveDeviceMgr.DeviceManagerException, ex:
        print str(ex)
        exit()
github openweave / openweave-core / src / test-apps / happy / lib / WeaveDeviceManager.py View on Github external
except WeaveDeviceMgr.DeviceManagerException, ex:
        print str(ex)
        exit()

    print "Done."

    print ''
    print '#################################rendezvous1#################################'
    try:
        devMgr.RendezvousDevice(
                                accessToken=options.accessToken,
                                targetFabricId=WeaveDeviceMgr.TargetFabricId_AnyFabric,
                                targetModes=WeaveDeviceMgr.TargetDeviceMode_Any,
                                targetVendorId=WeaveDeviceMgr.TargetVendorId_Any,
                                targetProductId=WeaveDeviceMgr.TargetProductId_Any,
                                targetDeviceId=WeaveDeviceMgr.TargetDeviceId_Any)
    except WeaveDeviceMgr.DeviceManagerException, ex:
        print str(ex)
        exit()

    print "Connected to device %X at %s" % (nodeId, addr)

    print ''
    print '#################################close#################################'

    try:
        devMgr.Close()
        devMgr.CloseEndpoints()
    except WeaveDeviceMgr.DeviceManagerException, ex:
        print str(ex)
        exit()
github openweave / openweave-core / src / device-manager / python / weave-device-mgr.py View on Github external
--target-device 

            Specifies that only the device with the given Weave node id should respond.
            A value of 0xFFFFFFFFFFFFFFFF (the default) specifies that all devices should
            respond.
        """

        args = shlex.split(line)

        optParser = OptionParser(usage=optparse.SUPPRESS_USAGE, option_class=ExtendedOption)
        optParser.add_option("", "--target-fabric", action="store", dest="targetFabricId", type="hexint", default=WeaveDeviceMgr.TargetFabricId_AnyFabric)
        optParser.add_option("", "--target-modes", action="store", dest="targetModes", type="hexint", default=WeaveDeviceMgr.TargetDeviceMode_Any)
        optParser.add_option("", "--target-vendor", action="store", dest="targetVendorId", type="hexint", default=WeaveDeviceMgr.TargetVendorId_Any)
        optParser.add_option("", "--target-product", action="store", dest="targetProductId", type="hexint", default=WeaveDeviceMgr.TargetProductId_Any)
        optParser.add_option("", "--target-device", action="store", dest="targetDeviceId", type="hexint", default=WeaveDeviceMgr.TargetDeviceId_Any)

        try:
            (options, remainingArgs) = optParser.parse_args(args)
        except SystemExit:
            return

        if (len(remainingArgs) > 1):
            print "Unexpected argument: " + remainingArgs[1]
            return

        try:
            self.devMgr.StartDeviceEnumeration(targetFabricId=options.targetFabricId,
                                         targetModes=options.targetModes,
                                         targetVendorId=options.targetVendorId,
                                         targetProductId=options.targetProductId,
                                         targetDeviceId=options.targetDeviceId)