text: /*
   * If not stated otherwise in this file or this component's Licenses.txt file the
   * following copyright and licenses apply:
   *
   * Copyright 2015 RDK Management
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
  */
  
  /**********************************************************************
     Copyright [2014] [Cisco Systems, Inc.]
   
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
   
         http://www.apache.org/licenses/LICENSE-2.0
   
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
  **********************************************************************/
  
  // actual_client_inline.cpp - [Generated by hdkcli_cpp]
  
  // Local header.
  #include "actual_client_inline.h"
  
  using namespace HDK;
  
  bool HDK::InitializeClient() throw()
  {
      return !!HDK_CLI_Init();
  }
  
  void HDK::UninitializeClient() throw()
  {
      HDK_CLI_Cleanup();
  }
  
  HDK::ClientError Cisco::CiscoAction
  (
      HDK::ITarget* pTarget,
      enum Cisco::CiscoActionResult* presult /* = NULL */,
      unsigned int timeoutSecs /* = 0 */
  ) throw()
  {
      if (!pTarget)
      {
          return ClientError_InvalidArg;
      }
      Cisco::CiscoActionStruct input;
  
      Cisco::CiscoActionResponseStruct output;
  
      ClientError error = pTarget->Request(timeoutSecs,
                                           ACTUAL_CLIENT_MOD_Module(),
                                           ACTUAL_CLIENT_MOD_MethodEnum_Cisco_CiscoAction,
                                           input,
                                           &output);
  
      const HDK_MOD_Method* pMethod = HDK_MOD_GetMethod(ACTUAL_CLIENT_MOD_Module(), ACTUAL_CLIENT_MOD_MethodEnum_Cisco_CiscoAction);
  
      // Get the result value.
      enum Cisco::CiscoActionResult result = output.get_CiscoActionResult();
      if (NULL != presult)
      {
          *presult = result;
      }
  
      // Determine if there was an HNAP-result, and whether it was an error or not.
      if ((ClientError_OK == error) && (HDK_XML_BuiltinElement_Unknown != pMethod->hnapResultElement))
      {
          if ((pMethod->hnapResultOK != (int)result) && (pMethod->hnapResultREBOOT != (int)result))
          {
              // An HNAP error response.
              error = HDK::ClientError_HnapMethod;
          }
      }
  
      return error;
  }
  