diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 5c0c2b50e5c1fe..f5bea2ee840858 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -109,7 +109,6 @@ DeviceController::DeviceController() mExchangeMgr = nullptr; mStorageDelegate = nullptr; mPairedDevicesInitialized = false; - mListenPort = CHIP_PORT; } CHIP_ERROR DeviceController::Init(ControllerInitParams params) @@ -120,6 +119,7 @@ CHIP_ERROR DeviceController::Init(ControllerInitParams params) { mSystemLayer = params.systemLayer; mInetLayer = params.inetLayer; + mListenPort = params.listenPort; } else { diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index c9eee9bca1df7e..f432a346286d61 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -102,6 +102,10 @@ struct ControllerInitParams ByteSpan controllerRCAC; uint16_t controllerVendorId; + + /* The port used for operational communication to listen for and send messages over UDP/TCP. + * The default value of `0` will pick any available port. */ + uint16_t listenPort = 0; }; enum CommissioningStage : uint8_t