From f6f2bfa768841a0df9775701368d2169bda4e395 Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Mon, 17 May 2021 19:39:21 +0000 Subject: [PATCH] Update Mbed shell application to update ongoing refactoring on master. Update according to changes to https://github.com/project-chip/connectedhomeip/pull/6765 . --- examples/shell/mbed/CMakeLists.txt | 3 --- examples/shell/mbed/cmd_mbed_utils.cpp | 16 +++++++++++----- examples/shell/mbed/main.cpp | 11 +++++++---- src/lib/shell/streamer_mbed.cpp | 2 +- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/examples/shell/mbed/CMakeLists.txt b/examples/shell/mbed/CMakeLists.txt index f3936e9e10881b..968e8c8588574a 100644 --- a/examples/shell/mbed/CMakeLists.txt +++ b/examples/shell/mbed/CMakeLists.txt @@ -30,11 +30,8 @@ target_include_directories(${APP_TARGET} PRIVATE ${APP_ROOT}/shell_common/include) target_sources(${APP_TARGET} PRIVATE - ${APP_ROOT}/shell_common/cmd_base64.cpp - ${APP_ROOT}/shell_common/cmd_device.cpp ${APP_ROOT}/shell_common/cmd_misc.cpp ${APP_ROOT}/shell_common/cmd_otcli.cpp - ${APP_ROOT}/shell_common/cmd_btp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cmd_mbed_utils.cpp ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp ) diff --git a/examples/shell/mbed/cmd_mbed_utils.cpp b/examples/shell/mbed/cmd_mbed_utils.cpp index f489f4d8f10bf0..b4f34febd4e311 100644 --- a/examples/shell/mbed/cmd_mbed_utils.cpp +++ b/examples/shell/mbed/cmd_mbed_utils.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ -#include +#include #include #include @@ -38,6 +38,9 @@ #include #include +#include + +#include #include #include @@ -800,7 +803,8 @@ int cmd_server_on(int argc, char ** argv) { CHIP_ERROR error = CHIP_NO_ERROR; INET_ERROR err; - const AdminId gAdminId = 0; + const AdminId gAdminId = 0; + secure_channel::MessageCounterManager gMessageCounterManager; AdminPairingInfo * adminInfo = nullptr; Optional peer(Transport::Type::kUndefined); @@ -860,7 +864,8 @@ int cmd_server_on(int argc, char ** argv) ExitNow(error = err;); } - err = gChipServer.sessionManager->Init(chip::kTestDeviceNodeId, &DeviceLayer::SystemLayer, gChipServer.udp, &gAdmin); + err = gChipServer.sessionManager->Init(chip::kTestDeviceNodeId, &DeviceLayer::SystemLayer, gChipServer.udp, &gAdmin, + &gMessageCounterManager); if (err != INET_NO_ERROR) { streamer_printf(sout, "ERROR: Session manager intialization failed\r\n"); @@ -884,7 +889,8 @@ int cmd_server_on(int argc, char ** argv) ExitNow(error = err;); } - err = gChipServer.sessionManager->Init(chip::kTestDeviceNodeId, &DeviceLayer::SystemLayer, gChipServer.tcp, &gAdmin); + err = gChipServer.sessionManager->Init(chip::kTestDeviceNodeId, &DeviceLayer::SystemLayer, gChipServer.tcp, &gAdmin, + &gMessageCounterManager); if (err != INET_NO_ERROR) { streamer_printf(sout, "ERROR: Session manager intialization failed\r\n"); @@ -895,7 +901,7 @@ int cmd_server_on(int argc, char ** argv) gChipServer.sessionManager->SetDelegate(&gCallbacks); err = gChipServer.sessionManager->NewPairing(peer, chip::kTestControllerNodeId, &gTestPairing, - chip::SecureSessionMgr::PairingDirection::kResponder, gAdminId); + chip::SecureSession::SessionRole::kResponder, gAdminId); if (err != INET_NO_ERROR) { streamer_printf(sout, "ERROR: set new pairing failed\r\n"); diff --git a/examples/shell/mbed/main.cpp b/examples/shell/mbed/main.cpp index a45d4a981c9cce..6f5acf3d65133e 100644 --- a/examples/shell/mbed/main.cpp +++ b/examples/shell/mbed/main.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ -#include +#include #include #include @@ -30,12 +30,18 @@ #include "ChipShellMbedCollection.h" #include +#include +#include using namespace chip; using namespace chip::Shell; int main() { + chip::Platform::MemoryInit(); + chip::DeviceLayer::PlatformMgr().InitChipStack(); + chip::DeviceLayer::PlatformMgr().StartEventLoopTask(); + // Initialize the default streamer that was linked. const int rc = streamer_init(streamer_get()); @@ -52,9 +58,6 @@ int main() #endif cmd_misc_init(); - cmd_base64_init(); - cmd_device_init(); - cmd_btp_init(); cmd_otcli_init(); cmd_mbed_utils_init(); diff --git a/src/lib/shell/streamer_mbed.cpp b/src/lib/shell/streamer_mbed.cpp index 357b63ecb5b920..88c2c1bf8387e3 100644 --- a/src/lib/shell/streamer_mbed.cpp +++ b/src/lib/shell/streamer_mbed.cpp @@ -20,7 +20,7 @@ * Source implementation of an input / output stream for stdio targets. */ -#include "shell_core.h" +#include #include #include