Skip to content

Commit

Permalink
Do not hardcode the UDP listen port in ChipDeviceController (#9339)
Browse files Browse the repository at this point in the history
* Do not hardcode the UDP listen port in ChipDeviceController

* Add the listen port to the init params

* Update src/controller/CHIPDeviceController.h

Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>

Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Sep 1, 2021
1 parent 01e8fa0 commit 1076117
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ DeviceController::DeviceController()
mExchangeMgr = nullptr;
mStorageDelegate = nullptr;
mPairedDevicesInitialized = false;
mListenPort = CHIP_PORT;
}

CHIP_ERROR DeviceController::Init(ControllerInitParams params)
Expand All @@ -120,6 +119,7 @@ CHIP_ERROR DeviceController::Init(ControllerInitParams params)
{
mSystemLayer = params.systemLayer;
mInetLayer = params.inetLayer;
mListenPort = params.listenPort;
}
else
{
Expand Down
4 changes: 4 additions & 0 deletions src/controller/CHIPDeviceController.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1076117

Please sign in to comment.