connectivitylayer/isce/isaaccessldd_ldd/src/isauserdevice.cpp
changeset 0 63b37f68c1ce
equal deleted inserted replaced
-1:000000000000 0:63b37f68c1ce
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "isauserdevice.h"            // For DISAUserDevice
       
    21 #include "isauserchannel.h"            // For DISAUserChannel
       
    22 #include "iadtrace.h"                // For ASSERT_RESET.. and fault codes.
       
    23 #include "iadinternaldefinitions.h"    // For KIADDriver...
       
    24 #include "OstTraceDefinitions.h"
       
    25 #ifdef OST_TRACE_COMPILER_IN_USE
       
    26 #include "isauserdeviceTraces.h"
       
    27 #endif
       
    28 
       
    29 // CONSTS
       
    30 const TInt KMajorVersionNumber = 1;
       
    31 const TInt KMinorVersionNumber = 0;
       
    32 const TInt KBuildVersionNumber = 1;
       
    33 
       
    34 EXPORT_C DISAUserDevice::DISAUserDevice(
       
    35         // None
       
    36         )
       
    37     {
       
    38     OstTrace0( TRACE_NORMAL, DISAUSERDEVICE_DISAUSERDEVICE_ENTRY, ">DISAUserDevice::DISAUserDevice" );
       
    39 
       
    40     C_TRACE( ( _T( "DISAUserDevice::DISAUserDevice ->" ) ) );
       
    41     iVersion = TVersion( KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber );
       
    42     //iParseMask |= KDeviceAllowUnit;   // NOTE! this was on in ISC, forcing ISC to use extensionldd for > 32 channels?
       
    43     iParseMask |= KDeviceAllowInfo;    
       
    44     C_TRACE( ( _T( "DISAUserDevice::DISAUserDevice <-" ) ) );
       
    45 
       
    46     OstTrace0( TRACE_NORMAL, DISAUSERDEVICE_DISAUSERDEVICE_EXIT, "<DISAUserDevice::DISAUserDevice" );
       
    47     }
       
    48 
       
    49 EXPORT_C DISAUserDevice::~DISAUserDevice(
       
    50         // None
       
    51         )
       
    52     {
       
    53     OstTrace0( TRACE_NORMAL, DUP1_DISAUSERDEVICE_DISAUSERDEVICE_ENTRY, ">DISAUserDevice::~DISAUserDevice" );
       
    54 
       
    55     C_TRACE( ( _T( "DISAUserDevice::~DISAUserDevice ->" ) ) );
       
    56     C_TRACE( ( _T( "DISAUserDevice::~DISAUserDevice <-" ) ) );
       
    57 
       
    58     OstTrace0( TRACE_NORMAL, DUP1_DISAUSERDEVICE_DISAUSERDEVICE_EXIT, "<DISAUserDevice::~DISAUserDevice" );
       
    59     }
       
    60 
       
    61 TInt DISAUserDevice::Install(
       
    62         // None
       
    63         )
       
    64     {
       
    65     OstTrace0( TRACE_NORMAL, DISAUSERDEVICE_INSTALL_ENTRY, "<>DISAUserDevice::Install" );
       
    66 
       
    67     C_TRACE( ( _T( "DISAUserDevice::Install -><-" ) ) );
       
    68     return ( SetName( &KIADDriverName ) );
       
    69 
       
    70     }
       
    71 
       
    72 void DISAUserDevice::GetCaps(
       
    73         TDes8& //aDes
       
    74         ) const
       
    75     {
       
    76     OstTrace0( TRACE_NORMAL, DISAUSERDEVICE_GETCAPS_ENTRY, ">DISAUserDevice::GetCaps" );
       
    77     C_TRACE( ( _T( "DISAUserDevice::GetCaps -><-" ) ) );
       
    78     OstTrace0( TRACE_NORMAL, DISAUSERDEVICE_GETCAPS_EXIT, "<DISAUserDevice::GetCaps" );
       
    79 
       
    80     }
       
    81 // 
       
    82 // context of the user thread
       
    83 // thread in CS
       
    84 //
       
    85 TInt DISAUserDevice::Create(
       
    86         DLogicalChannelBase*& aChannel
       
    87         )
       
    88     {
       
    89     OstTrace1( TRACE_NORMAL, DISAUSERDEVICE_CREATE_ENTRY, ">DISAUserDevice::Create;aChannel=%x", ( TUint )( aChannel ) );
       
    90 
       
    91     C_TRACE( ( _T( "DISAUserDevice::Create 0x%x ->" ), &aChannel ) );
       
    92     aChannel = new DISAUserChannel();
       
    93     C_TRACE( ( _T( "DISAUserDevice::Create 0x%x <-" ), &aChannel ) );    
       
    94 
       
    95     TInt retVal = aChannel ? KErrNone : KErrNoMemory;
       
    96     OstTrace1( TRACE_NORMAL, DISAUSERDEVICE_CREATE_EXIT, "DISAUserDevice::Create;retVal=%d", retVal );
       
    97     return retVal;    
       
    98     }
       
    99 
       
   100 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   101 
       
   102 // -----------------------------------------------------------------------------
       
   103 // Standard LDD entry point macro
       
   104 // ( other items were commented in a header ).
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 DECLARE_STANDARD_LDD()
       
   108     {
       
   109     OstTrace0( TRACE_NORMAL, _DECLARE_STANDARD_LDD_ENTRY, ">DISAUserDevice    ::DECLARE_STANDARD_LDD" );
       
   110 
       
   111     C_TRACE( ( _T( "DISAUserDevice::DECLARE_STANDARD_LDD ->" ) ) );    
       
   112     DISAUserDevice* device = new DISAUserDevice;
       
   113     ASSERT_RESET_ALWAYS( device, EIADMemoryAllocationFailure | EIADFaultIdentifier23 << KFaultIdentifierShift );
       
   114     C_TRACE( ( _T( "DISAUserDevice::DECLARE_STANDARD_LDD <-" ) ) );    
       
   115     
       
   116     OstTrace1( TRACE_NORMAL, _DECLARE_STANDARD_LDD_EXIT, "::DECLARE_STANDARD_LDD;device=%x", device );
       
   117     return device;    
       
   118     }