bluetoothengine/headsetsimulator/profiles/hspprofile/src/hspprofile.cpp
branchheadsetsimulator
changeset 60 90dbfc0435e3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/headsetsimulator/profiles/hspprofile/src/hspprofile.cpp	Wed Sep 15 15:59:44 2010 +0200
@@ -0,0 +1,102 @@
+/* 
+ *
+ * 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 "hspprofileplugin.h"
+#include "hspdatahandler.h"
+#include "hspsettings.h"
+#include "debug.h"
+
+CHsHSPProfile* CHsHSPProfile::NewL()
+    {
+    CHsHSPProfile *self = CHsHSPProfile::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CHsHSPProfile* CHsHSPProfile::NewLC()
+    {
+    CHsHSPProfile *self = new ( ELeave ) CHsHSPProfile;
+    CleanupStack::PushL( self );
+    self->ContructL();
+    return self;
+    }
+
+CHsHSPProfile::CHsHSPProfile()
+    {
+
+    }
+
+void CHsHSPProfile::ContructL()
+    {
+    iDataHandler = CHsHSPDataHandler::NewL();
+    iSettings = CHsHSPSettings::InstanceL();
+    }
+
+CHsHSPProfile::~CHsHSPProfile()
+    {
+    if ( iDataHandler )
+        {
+        delete iDataHandler;
+        }
+    if ( iSettings )
+        {
+        iSettings->Release();
+        }
+    }
+
+void CHsHSPProfile::HandleCommandL( const TDesC8& aCommandsIn,
+        TDes8& aCommandsOut, const TBool aFromAG )
+    {
+    TRACE_FUNC_ENTRY
+
+    iDataHandler->ProcessDataL( aCommandsIn, aFromAG, aCommandsOut );
+
+    TRACE_FUNC_EXIT
+    }
+
+void CHsHSPProfile::HandleClientDisconnected( TInt aErr )
+    {
+    TRACE_FUNC_ENTRY
+    iDataHandler->HandleClientDisconnected( aErr );
+    TRACE_FUNC_EXIT
+    }
+
+void CHsHSPProfile::HandleClientConnected( TDes8& aCommandOut )
+    {
+    TRACE_FUNC_ENTRY
+    iDataHandler->HandleClientConnected( aCommandOut );
+    TRACE_FUNC_EXIT
+    }
+
+void CHsHSPProfile::HandleAcceptCallL( TDes8& aCommandOut )
+    {
+    TRACE_FUNC_ENTRY
+
+    iDataHandler->HandleAcceptCallL( aCommandOut );
+
+    TRACE_FUNC_EXIT
+    }
+
+void CHsHSPProfile::HandleReleaseCallL( TDes8& aCommandOut )
+    {
+    TRACE_FUNC_ENTRY
+
+    iDataHandler->HandleReleaseCallL( aCommandOut );
+
+    TRACE_FUNC_EXIT
+    }