bluetoothengine/headsetsimulator/profiles/hfpprofile/src/features/hfpcallinglineidentification.cpp
branchheadsetsimulator
changeset 60 90dbfc0435e3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/headsetsimulator/profiles/hfpprofile/src/features/hfpcallinglineidentification.cpp	Wed Sep 15 15:59:44 2010 +0200
@@ -0,0 +1,104 @@
+/* 
+ *
+ * Copyright (c) <2010> Comarch S.A. and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Original Contributors:
+ * Comarch S.A. - original contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include "hfpcallinglineidentification.h"
+#include "hfpcommand.h"
+#include "hfpsettings.h"
+#include "debug.h"
+
+CHsHFPCallingLineIdentification* CHsHFPCallingLineIdentification::NewL(
+        MHsHFPFeatureProviderObserver* aObserver )
+    {
+    CHsHFPCallingLineIdentification *self =
+            CHsHFPCallingLineIdentification::NewLC( aObserver );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+CHsHFPCallingLineIdentification* CHsHFPCallingLineIdentification::NewLC(
+        MHsHFPFeatureProviderObserver* aObserver )
+    {
+    CHsHFPCallingLineIdentification *self =
+            new ( ELeave ) CHsHFPCallingLineIdentification( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+CHsHFPCallingLineIdentification::~CHsHFPCallingLineIdentification()
+    {
+    TRACE_FUNC_ENTRY
+    if ( iSettings )
+        {
+        iSettings->Release();
+        }
+    TRACE_FUNC_EXIT
+    }
+
+TInt CHsHFPCallingLineIdentification::ProcessCommand(
+        const CHsHFPCommand &aInputCmd, CHsHFPCommand &aOutputCmd )
+    {
+    TRACE_FUNC_ENTRY
+
+    TInt res = KErrNone;
+    if ( aInputCmd.FromAG() )
+        {
+        if ( iWaitingForOK && aInputCmd.Type() == EHFPCmdOK )
+            {
+            iWaitingForOK = EFalse;
+            iObserver->HandleProcedureCompleted( KErrNone );
+            }
+        else if ( aInputCmd.Type() == EHFPCmdCLIP )
+            {
+            iObserver->HandleProcedureCompleted( KErrNone );
+            }
+        else
+            {
+            res = KErrArgument;
+            }
+        }
+    else
+        {
+        if ( aInputCmd.Type() == EHFPCmdCLIP )
+            {
+            iWaitingForOK = ETrue;
+            TRAP(res,CHsHFPCommand::CopyL( aInputCmd, aOutputCmd ));
+            }
+        else
+            {
+            res = KErrArgument;
+            }
+        }
+
+    TRACE_FUNC_EXIT
+    return res;
+    }
+
+CHsHFPCallingLineIdentification::CHsHFPCallingLineIdentification(
+        MHsHFPFeatureProviderObserver* aObserver ) :
+    iObserver( aObserver )
+    {
+
+    }
+
+void CHsHFPCallingLineIdentification::ConstructL()
+    {
+    iSettings = CHsHFPSettings::InstanceL();
+    }
+