How to use the openweave.WeaveBluezMgr.BluezManager 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
nodeId = int(remainingArgs[0], 16)
        remainingArgs.pop(0)
    else:
        nodeId = 1

    if (options.useDummyAccessToken and not options.accessToken):
        options.accessToken = base64.standard_b64decode(dummyAccessToken)
    if (options.pairingCode and options.accessToken):
        print "Cannot specify both pairing code and access token"
        exit()

    try:
        if options.useBle:
            from openweave.WeaveBluezMgr import BluezManager as BleManager
            from openweave.WeaveBleUtility import FAKE_CONN_OBJ_VALUE
            bleManager = BleManager(devMgr)

            try:
                bleManager.ble_adapter_select(identifier=options.bleSrcAddr)
            except WeaveDeviceMgr.DeviceManagerException, ex:
                print ex
                exit()

            try:
                line = ' ' + str(options.bleDstAddr)
                bleManager.scan_connect(line)
            except WeaveDeviceMgr.DeviceManagerException, ex:
                print ex
                exit()

            devMgr.ConnectBle(bleConnection=FAKE_CONN_OBJ_VALUE,
                                   pairingCode=options.pairingCode,