From 4c49ca91b3903ed04e21ac6bbed4ff9a70e9986f Mon Sep 17 00:00:00 2001 From: Wahaj Syed Date: Thu, 6 May 2021 00:07:25 +0000 Subject: [PATCH] Move the csg additions to above the main method, cannot forward declare the methods --- src/controller/python/chip-device-ctrl.py | 26 ++++++----------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/controller/python/chip-device-ctrl.py b/src/controller/python/chip-device-ctrl.py index dde24d597933f2..87a5a1dd0163a6 100755 --- a/src/controller/python/chip-device-ctrl.py +++ b/src/controller/python/chip-device-ctrl.py @@ -904,8 +904,8 @@ def __check_supported_os()-> bool: def main(): start_rpc_server() - - # Never Executed: does not return here + + # Never reach here optParser = OptionParser() optParser.add_option( "-r", @@ -934,15 +934,9 @@ def main(): dest="bluetoothAdapter", default="hci0", type="str", - help="Controller bluetooth adapter ID, use --no-ble to disable bluetooth functions.", + help="Controller bluetooth adapter ID", metavar="", ) - optParser.add_option( - "--no-ble", - action="store_true", - dest="disableBluetooth", - help="Disable bluetooth, calling BLE related feature with this flag results in undefined behavior.", - ) (options, remainingArgs) = optParser.parse_args(sys.argv[1:]) if len(remainingArgs) != 0: @@ -951,9 +945,7 @@ def main(): adapterId = None if sys.platform.startswith("linux"): - if options.disableBluetooth: - adapterId = None - elif not options.bluetoothAdapter.startswith("hci"): + if not options.bluetoothAdapter.startswith("hci"): print( "Invalid bluetooth adapter: {}, adapter name looks like hci0, hci1 etc.") sys.exit(-1) @@ -965,14 +957,8 @@ def main(): "Invalid bluetooth adapter: {}, adapter name looks like hci0, hci1 etc.") sys.exit(-1) - try: - devMgrCmd = DeviceMgrCmd(rendezvousAddr=options.rendezvousAddr, - controllerNodeId=options.controllerNodeId, bluetoothAdapter=adapterId) - except Exception as ex: - print(ex) - print("Failed to bringup CHIPDeviceController CLI") - sys.exit(1) - + devMgrCmd = DeviceMgrCmd(rendezvousAddr=options.rendezvousAddr, + controllerNodeId=options.controllerNodeId, bluetoothAdapter=adapterId) print("Chip Device Controller Shell") if options.rendezvousAddr: print("Rendezvous address set to %s" % options.rendezvousAddr)