Skip to content

Commit f28e812

Browse files
committed
Merge branch 'master' of https://github.com/project-chip/connectedhomeip into bump_CI_images
2 parents 25335e1 + 9e057a3 commit f28e812

File tree

7 files changed

+38
-15
lines changed

7 files changed

+38
-15
lines changed

docs/guides/fabric_synchronization_guide.md

+8
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ Pair the Ecosystem 2 bridge to Ecosystem 1 with node ID 2:
110110
fabricsync add-bridge 2 <e2-fabric-bridge-ip>
111111
```
112112

113+
This command will initiate the reverse commissioning process. After a few
114+
seconds, you should see the following message, indicating that the local bridge
115+
of Ecosystem 1 has successfully paired with Ecosystem 2 on Endpoint 2:
116+
117+
```
118+
>>> A new device is added on Endpoint 2.
119+
```
120+
113121
### Pair Light Example to Ecosystem 2
114122

115123
Since Fabric-Bridge also functions as a Matter server, running it alongside the

examples/common/pigweed/protos/fabric_admin_service.proto

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ message DeviceCommissioningInfo {
1919
uint32 discriminator = 1;
2020
uint32 iterations = 2;
2121
uint32 setup_pin = 3;
22-
bytes salt = 4;
22+
uint32 vendor_id = 4;
23+
uint32 product_id = 5;
24+
bytes salt = 6;
2325
}
2426

2527
message KeepActiveParameters {

examples/fabric-admin/device_manager/DeviceManager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ class DeviceManager : public PairingDelegate
156156

157157
void HandleCommandResponse(const chip::app::ConcreteCommandPath & path, chip::TLV::TLVReader & data);
158158

159-
void OnDeviceRemoved(chip::NodeId deviceId, CHIP_ERROR err) override;
160-
161159
private:
162160
friend DeviceManager & DeviceMgr();
163161

162+
void OnDeviceRemoved(chip::NodeId deviceId, CHIP_ERROR err) override;
163+
164164
void RequestCommissioningApproval();
165165

166166
void HandleReadSupportedDeviceCategories(chip::TLV::TLVReader & data);

examples/fabric-admin/rpc/RpcServer.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <commands/fabric-sync/FabricSyncCommand.h>
3030
#include <commands/interactive/InteractiveCommands.h>
3131
#include <device_manager/DeviceManager.h>
32-
#include <setup_payload/ManualSetupPayloadGenerator.h>
32+
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
3333
#include <system/SystemClock.h>
3434

3535
#if defined(PW_RPC_FABRIC_ADMIN_SERVICE) && PW_RPC_FABRIC_ADMIN_SERVICE
@@ -103,16 +103,18 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate
103103

104104
setupPayload.setUpPINCode = request.setup_pin;
105105
setupPayload.version = 0;
106+
setupPayload.vendorID = request.vendor_id;
107+
setupPayload.productID = request.product_id;
106108
setupPayload.rendezvousInformation.SetValue(RendezvousInformationFlag::kOnNetwork);
107109

108110
SetupDiscriminator discriminator{};
109111
discriminator.SetLongValue(request.discriminator);
110112
setupPayload.discriminator = discriminator;
111113

112-
char payloadBuffer[kMaxManualCodeLength + 1];
113-
MutableCharSpan manualCode(payloadBuffer);
114+
QRCodeSetupPayloadGenerator generator(setupPayload);
115+
std::string code;
116+
CHIP_ERROR error = generator.payloadBase38RepresentationWithAutoTLVBuffer(code);
114117

115-
CHIP_ERROR error = ManualSetupPayloadGenerator(setupPayload).payloadDecimalStringRepresentation(manualCode);
116118
if (error == CHIP_NO_ERROR)
117119
{
118120
NodeId nodeId = DeviceMgr().GetNextAvailableNodeId();
@@ -121,11 +123,11 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate
121123
// RequestCommissioningApproval, you need to wait for it to open a commissioning window on its bridge.
122124
usleep(kCommissionPrepareTimeMs * 1000);
123125

124-
DeviceMgr().PairRemoteDevice(nodeId, payloadBuffer);
126+
DeviceMgr().PairRemoteDevice(nodeId, code.c_str());
125127
}
126128
else
127129
{
128-
ChipLogError(NotSpecified, "Unable to generate manual code for setup payload: %" CHIP_ERROR_FORMAT, error.Format());
130+
ChipLogError(NotSpecified, "Unable to generate pairing code for setup payload: %" CHIP_ERROR_FORMAT, error.Format());
129131
}
130132

131133
return pw::OkStatus();

examples/fabric-bridge-app/linux/CommissionerControl.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ CHIP_ERROR CommissionerControlDelegate::HandleCommissionNode(const Commissioning
137137
.SetTimeout(params.commissioningTimeout)
138138
.SetDiscriminator(params.discriminator)
139139
.SetIteration(params.iterations)
140-
.SetSalt(params.salt));
140+
.SetSalt(params.salt),
141+
mVendorId, mProductId);
141142
#else
142143
ChipLogProgress(NotSpecified, "Failed to reverse commission bridge: PW_RPC_FABRIC_BRIDGE_SERVICE not defined");
143144
return CHIP_ERROR_NOT_IMPLEMENTED;

examples/fabric-bridge-app/linux/RpcClient.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,14 @@ OpenCommissioningWindow(chip::Controller::CommissioningWindowVerifierParams para
163163
}
164164

165165
CHIP_ERROR
166-
CommissionNode(chip::Controller::CommissioningWindowPasscodeParams params)
166+
CommissionNode(chip::Controller::CommissioningWindowPasscodeParams params, VendorId vendorId, uint16_t productId)
167167
{
168168
chip_rpc_DeviceCommissioningInfo device;
169169
device.setup_pin = params.GetSetupPIN();
170170
device.discriminator = params.GetDiscriminator();
171171
device.iterations = params.GetIteration();
172+
device.vendor_id = vendorId;
173+
device.product_id = productId;
172174

173175
VerifyOrReturnError(params.GetSalt().size() <= sizeof(device.salt.bytes), CHIP_ERROR_BUFFER_TOO_SMALL);
174176
memcpy(device.salt.bytes, params.GetSalt().data(), params.GetSalt().size());

examples/fabric-bridge-app/linux/include/RpcClient.h

+12-4
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,20 @@ OpenCommissioningWindow(chip::Controller::CommissioningWindowVerifierParams para
6060
/**
6161
* Commission a node using the specified parameters.
6262
*
63-
* @param params Params for commissioning the device using passcode.
63+
* This function initiates the commissioning process for a node, utilizing
64+
* the provided passcode parameters, vendor ID, and product ID.
65+
*
66+
* @param params Parameters required for commissioning the device using passcode.
67+
* @param vendorId The Vendor ID (VID) of the device being commissioned. This identifies
68+
* the manufacturer of the device.
69+
* @param productId The Product ID (PID) of the device being commissioned. This identifies
70+
* the specific product within the vendor's lineup.
71+
*
6472
* @return CHIP_ERROR An error code indicating the success or failure of the operation.
65-
* - CHIP_NO_ERROR: The RPC command was successfully sent.
66-
* - CHIP_ERROR_INTERNAL: An internal error occurred.
73+
* - CHIP_NO_ERROR: The RPC command was successfully sent and the commissioning process was initiated.
74+
* - CHIP_ERROR_INTERNAL: An internal error occurred during the preparation or sending of the command.
6775
*/
6876
CHIP_ERROR
69-
CommissionNode(chip::Controller::CommissioningWindowPasscodeParams params);
77+
CommissionNode(chip::Controller::CommissioningWindowPasscodeParams params, chip::VendorId vendorId, uint16_t productId);
7078

7179
CHIP_ERROR KeepActive(chip::NodeId nodeId, uint32_t stayActiveDurationMs);

0 commit comments

Comments
 (0)