How to use the openweave.WeaveBleUtility.FAKE_CONN_OBJ_VALUE 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
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,
                                   accessToken=options.accessToken)
            try:
                devMgr.Close()
                devMgr.CloseEndpoints()
                bleManager.disconnect()
            except WeaveDeviceMgr.DeviceManagerException, ex:
                print str(ex)
                exit()

            print "WoBLE central is good to go"
            print "Shutdown complete"
            exit()

        else:
            devMgr.ConnectDevice(deviceId=nodeId, deviceAddr=addr,
github openweave / openweave-core / src / device-manager / python / weave-device-mgr.py View on Github external
remainingArgs.pop(0)

        if (len(remainingArgs)):
            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"
            return
        try:
            if options.useBle:
                self.devMgr.ConnectBle(bleConnection=FAKE_CONN_OBJ_VALUE,
                                       pairingCode=options.pairingCode,
                                       accessToken=options.accessToken)
            else:
                self.devMgr.ConnectDevice(deviceId=nodeId, deviceAddr=addr,
                                          pairingCode=options.pairingCode,
                                          accessToken=options.accessToken)
        except WeaveDeviceMgr.DeviceManagerException, ex:
            print str(ex)
            return

        print "Connected to device."
    def do_blediagtest(self, line):
github openweave / openweave-core / src / device-manager / python / weave-device-mgr.py View on Github external
return

        if options.local:
            local = 1
        else:
            local = 0

        if not self.bleMgr:
            self.bleMgr = BleManager(self.devMgr)

        if not self.bleMgr.isConnected():
            print "BLE not connected"
            return

        try:
            self.devMgr.TestResultBle(FAKE_CONN_OBJ_VALUE, local)
        except WoBleTestMgr.DeviceManagerException, ex:
            print str(ex)
        return