omadrm/drmengine/drmserviceapi/src/drmserviceapi.cpp
changeset 23 493788a4a8a4
parent 0 95b198f216e5
equal deleted inserted replaced
5:79d62d1d7957 23:493788a4a8a4
    17 
    17 
    18 
    18 
    19 
    19 
    20 #include <drmserviceapi.h>
    20 #include <drmserviceapi.h>
    21 
    21 
    22 #include "roapstorageclient.h"
    22 #include "RoapStorageClient.h"
    23 #include "drmclockclient.h"
    23 #include "DRMClockClient.h"
    24 
    24 
    25 
    25 
    26 // ======== LOCAL FUNCTIONS ========
    26 // ======== LOCAL FUNCTIONS ========
    27 
    27 
    28 // ======== MEMBER FUNCTIONS ========
    28 // ======== MEMBER FUNCTIONS ========
    63         {
    63         {
    64         iClockClient->Close();
    64         iClockClient->Close();
    65         delete iClockClient;
    65         delete iClockClient;
    66         iClockClient = NULL;
    66         iClockClient = NULL;
    67         }
    67         }
    68     
    68 
    69     // Roap storage client
    69     // Roap storage client
    70     if( iRoapStorageClient )
    70     if( iRoapStorageClient )
    71         {
    71         {
    72         iRoapStorageClient->Close();
    72         iRoapStorageClient->Close();
    73         delete iRoapStorageClient;
    73         delete iRoapStorageClient;
    77 
    77 
    78 // ---------------------------------------------------------------------------
    78 // ---------------------------------------------------------------------------
    79 // CDrmServiceApi::GetSecureTime
    79 // CDrmServiceApi::GetSecureTime
    80 // ---------------------------------------------------------------------------
    80 // ---------------------------------------------------------------------------
    81 //
    81 //
    82 EXPORT_C TInt DRM::CDrmServiceApi::GetSecureTime( 
    82 EXPORT_C TInt DRM::CDrmServiceApi::GetSecureTime(
    83     TTime& aTime, 
    83     TTime& aTime,
    84     TInt& aTimeZone,
    84     TInt& aTimeZone,
    85     DRMClock::ESecurityLevel& aSecurityLevel ) const
    85     DRMClock::ESecurityLevel& aSecurityLevel ) const
    86     {
    86     {
    87     return iClockClient->GetSecureTime( aTime, aTimeZone, aSecurityLevel);    
    87     return iClockClient->GetSecureTime( aTime, aTimeZone, aSecurityLevel);
    88     };
    88     };
    89                         
    89 
    90 // ---------------------------------------------------------------------------
    90 // ---------------------------------------------------------------------------
    91 // CDrmServiceApi::UpdateSecureTime
    91 // CDrmServiceApi::UpdateSecureTime
    92 // ---------------------------------------------------------------------------
    92 // ---------------------------------------------------------------------------
    93 //
    93 //
    94 EXPORT_C TInt DRM::CDrmServiceApi::UpdateSecureTime( const TTime& aTime, const TInt& aTimeZone )
    94 EXPORT_C TInt DRM::CDrmServiceApi::UpdateSecureTime( const TTime& aTime, const TInt& aTimeZone )
   130 //
   130 //
   131 void DRM::CDrmServiceApi::ConstructL()
   131 void DRM::CDrmServiceApi::ConstructL()
   132     {
   132     {
   133     // Create an instance of the clock client
   133     // Create an instance of the clock client
   134     iClockClient = new (ELeave) RDRMClockClient;
   134     iClockClient = new (ELeave) RDRMClockClient;
   135     
   135 
   136     // Connect to the server
   136     // Connect to the server
   137     User::LeaveIfError( iClockClient->Connect() );
   137     User::LeaveIfError( iClockClient->Connect() );
   138     
   138 
   139     // Create and instance of the roap storage client
   139     // Create and instance of the roap storage client
   140     iRoapStorageClient = new (ELeave) Roap::RRoapStorageClient;
   140     iRoapStorageClient = new (ELeave) Roap::RRoapStorageClient;
   141 
   141 
   142     // Connect to the server
   142     // Connect to the server
   143     User::LeaveIfError( iRoapStorageClient->Connect() );
   143     User::LeaveIfError( iRoapStorageClient->Connect() );