Skip to content

Commit

Permalink
LMS: consolidate RedirectionService WsMan
Browse files Browse the repository at this point in the history
Consolidate RedirectionService WsMan client into one class to
eliminate code duplication.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
  • Loading branch information
ausyskin authored and Tomas Winkler committed Mar 16, 2020
1 parent 1bb305a commit 8cd99bd
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 98 deletions.
6 changes: 3 additions & 3 deletions MEWMIProv/Src/WSmanCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "WSmanCommands.h"
#include "SIOWSManClient.h"
#include "KVMWSManClient.h"
#include "RedirectionServiceWSManClient.h"
#include "AMTRedirectionServiceWSManClient.h"
#include "StringManipulator.h"
using namespace std;

Expand All @@ -40,7 +40,7 @@ UINT32 WSmanCommands::TerminateKVMSession(void)

UINT32 WSmanCommands::isIDEREnabled(bool *enabled)
{
RedirectionServiceWSManClient redirectionClient;
AMTRedirectionServiceWSManClient redirectionClient;
unsigned short state;
*enabled = false;

Expand Down Expand Up @@ -69,7 +69,7 @@ UINT32 WSmanCommands::isIDEREnabled(bool *enabled)

UINT32 WSmanCommands::isSOLEnabled(bool *enabled)
{
RedirectionServiceWSManClient redirectionClient;
AMTRedirectionServiceWSManClient redirectionClient;
unsigned short state;
*enabled = false;

Expand Down
14 changes: 13 additions & 1 deletion WsmanClient/AMTRedirectionServiceWSManClient.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: Apache-2.0 */
/*
* Copyright (C) 2009-2019 Intel Corporation
* Copyright (C) 2009-2020 Intel Corporation
*/
/*++
Expand Down Expand Up @@ -56,6 +56,18 @@ bool AMTRedirectionServiceWSManClient::TerminateSession(unsigned int SessionType
return true;
}

bool AMTRedirectionServiceWSManClient::RedirectionState(unsigned short *state)
{
if (!Init(true))
return false;
if (m_service.EnabledStateExists())
{
*state = m_service.EnabledState();
return true;
}
return false;
}

bool AMTRedirectionServiceWSManClient::Init(bool forceGet)
{
if (!forceGet && m_isInit)
Expand Down
3 changes: 2 additions & 1 deletion WsmanClient/AMTRedirectionServiceWSManClient.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: Apache-2.0 */
/*
* Copyright (C) 2009-2019 Intel Corporation
* Copyright (C) 2009-2020 Intel Corporation
*/
#pragma once

Expand All @@ -24,6 +24,7 @@ class WSMAN_DLL_API AMTRedirectionServiceWSManClient :
AMTRedirectionServiceWSManClient(void);
virtual ~AMTRedirectionServiceWSManClient(void);
bool TerminateSession(unsigned int SessionType);
bool RedirectionState(unsigned short *state);
bool Init(bool forceGet= false);
private:

Expand Down
3 changes: 1 addition & 2 deletions WsmanClient/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2010-2019 Intel Corporation
# Copyright (C) 2010-2020 Intel Corporation
cmake_minimum_required (VERSION 3.1)

add_subdirectory ("${TOP_DIR}/CIM_Framework" "CIM_Framework")
Expand All @@ -21,7 +21,6 @@ add_library (LmsWsmanClient SHARED
KVMScreenSettingClient.cpp
KVMWSManClient.cpp
PowerManagementCapabilitiesWsManClient.cpp
RedirectionServiceWSManClient.cpp
SIOWSManClient.cpp
SyncIpClient.cpp
TimeSynchronizationClient.cpp
Expand Down
56 changes: 0 additions & 56 deletions WsmanClient/RedirectionServiceWSManClient.cpp

This file was deleted.

35 changes: 0 additions & 35 deletions WsmanClient/RedirectionServiceWSManClient.h

This file was deleted.

0 comments on commit 8cd99bd

Please sign in to comment.