Skip to content

Commit

Permalink
Fix merge issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmelveilleux committed Dec 1, 2021
1 parent bdf30ee commit e9ceb3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 3 additions & 6 deletions examples/chip-tool/commands/common/CHIPCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "CHIPCommand.h"

#include <controller/CHIPDeviceControllerFactory.h>
#include <controller/ExampleOperationalCredentialsIssuer.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/DeviceAttestationVerifier.h>
#include <credentials/examples/DefaultDeviceAttestationVerifier.h>
Expand All @@ -40,8 +39,6 @@ constexpr chip::FabricId kCommissionerGammaFabricId = 3;

CHIP_ERROR CHIPCommand::Run()
{
chip::Controller::ExampleOperationalCredentialsIssuer opCredsIssuer;

#if CHIP_DEVICE_LAYER_TARGET_LINUX && CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
// By default, Linux device is configured as a BLE peripheral while the controller needs a BLE central.
ReturnLogErrorOnFailure(chip::DeviceLayer::Internal::BLEMgrImpl().ConfigureBle(0, true));
Expand Down Expand Up @@ -146,14 +143,14 @@ CHIP_ERROR CHIPCommand::InitializeCommissioner(std::string key, chip::FabricId f
// store the credentials in persistent storage, and
// generate when not available in the storage.
ReturnLogErrorOnFailure(mCommissionerStorage.Init(key.c_str()));
ReturnLogErrorOnFailure(opCredsIssuer.Initialize(mCommissionerStorage));
ReturnLogErrorOnFailure(opCredsIssuer.GenerateNOCChainAfterValidation(mCommissionerStorage.GetLocalNodeId(), fabricId,
ReturnLogErrorOnFailure(mOpCredsIssuer.Initialize(mCommissionerStorage));
ReturnLogErrorOnFailure(mOpCredsIssuer.GenerateNOCChainAfterValidation(mCommissionerStorage.GetLocalNodeId(), fabricId,
ephemeralKey.Pubkey(), rcacSpan, icacSpan, nocSpan));

std::unique_ptr<ChipDeviceCommissioner> commissioner = std::make_unique<ChipDeviceCommissioner>();
chip::Controller::SetupParams commissionerParams;
commissionerParams.storageDelegate = &mCommissionerStorage;
commissionerParams.operationalCredentialsDelegate = &opCredsIssuer;
commissionerParams.operationalCredentialsDelegate = &mOpCredsIssuer;
commissionerParams.ephemeralKeypair = &ephemeralKey;
commissionerParams.controllerRCAC = rcacSpan;
commissionerParams.controllerICAC = icacSpan;
Expand Down
3 changes: 3 additions & 0 deletions examples/chip-tool/commands/common/CHIPCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#pragma once

#include <controller/ExampleOperationalCredentialsIssuer.h>

#include "../../config/PersistentStorage.h"
#include "Command.h"

Expand Down Expand Up @@ -65,6 +67,7 @@ class CHIPCommand : public Command
PersistentStorage mDefaultStorage;
PersistentStorage mCommissionerStorage;
chip::SimpleFabricStorage mFabricStorage;
chip::Controller::ExampleOperationalCredentialsIssuer mOpCredsIssuer;

// This method returns the commissioner instance to be used for running the command.
// The default commissioner instance name is "alpha", but it can be overriden by passing
Expand Down

0 comments on commit e9ceb3f

Please sign in to comment.