bluetoothengine/btmac/src/BTMonoCmdHandler/btmcprotocol.cpp
changeset 19 43824b19ee35
parent 15 00f9ee97d895
child 21 53b7818cd282
--- a/bluetoothengine/btmac/src/BTMonoCmdHandler/btmcprotocol.cpp	Mon May 03 12:40:50 2010 +0300
+++ b/bluetoothengine/btmac/src/BTMonoCmdHandler/btmcprotocol.cpp	Fri May 14 16:01:46 2010 +0300
@@ -290,7 +290,7 @@
        		{
        		TBuf8<RMobilePhone::KIMSISize> buf;
        		buf.Copy(iId);
-            CATResult* cimi = CATResult::NewLC(EATCIMI, EATReadResult, TATParam(buf));
+            CATResult* cimi = CATResult::NewLC(EATCIMI, EATActionResult, TATParam(buf));
             SendResponseL(*cimi);
 	        CleanupStack::PopAndDestroy(cimi);
 	        CATResult* ok = CATResult::NewLC(EATOK);
@@ -789,56 +789,7 @@
                     break;  
                 };
             break;  
-            }
-        case EATCSQ:
-            {
-            TRACE_INFO(_L("Requesting Signal strength"));
-            LEAVE_IF_ERROR(params.Append(TATParam(iPhoneStatus->GetRssiStrength())))
-            LEAVE_IF_ERROR(params.Append(TATParam(KBerUnknown)))
-            code = CATResult::NewL(EATCSQ, EATReadResult, &params);
-            TRACE_INFO(_L("done"));
-            break;
-            }
-
-        case EATCGSN:
-            {
-            TBuf8<RMobilePhone::KPhoneSerialNumberSize> buf;
-            buf.Copy(iIdentity.iSerialNumber);
-            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
-            code = CATResult::NewL(EATCGSN, EATReadResult, &params);
-            break;
-            }
-        case EATCGMI:
-            {
-            TBuf8<RMobilePhone::KPhoneManufacturerIdSize> buf;
-            buf.Copy(iIdentity.iManufacturer);
-            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
-            code = CATResult::NewL(EATCGMI, EATReadResult, &params);
-            break;
-            }
-        case EATCGMM:
-            {
-            TBuf8<RMobilePhone::KPhoneModelIdSize> buf;
-            buf.Copy(iIdentity.iModel);
-            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
-            code = CATResult::NewL(EATCGMM, EATReadResult, &params);
-            break;      
-            }
-        case EATCGMR:
-            {
-            TBuf8<RMobilePhone::KPhoneRevisionIdSize> buf;
-            buf.Copy(iIdentity.iRevision);
-            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
-            code = CATResult::NewL(EATCGMR, EATReadResult, &params);
-            break;      
-            }
-        case EATCIMI:
-            {
-            iEtelQuery->SetServiceId(KQueryIMSI);
-            iPhone.GetSubscriberId(iEtelQuery->iStatus, iId);
-            iEtelQuery->GoActive();
-            break;
-            }
+            }        
         case EATCOLP:
             {
             LEAVE_IF_ERROR(params.Append(TATParam(TInt(iProtocolStatus->iOutgoingCallNotif))))
@@ -1040,7 +991,11 @@
 void CBtmcProtocol::HandleActionCommandL(const CATCommand& aCmd)
     {
     TRACE_FUNC
-    
+    RATResultPtrArray resarr;
+    ATObjArrayCleanupResetAndDestroyPushL(resarr);    
+    CATResult* code = NULL;
+    RATParamArray params;
+    CleanupClosePushL(params);
     switch (aCmd.Id())
         {
         case EATCNUM:
@@ -1054,33 +1009,71 @@
             iCallStatus->HandleClccL();
             break;
             }
+        case EATCSQ:
+            {
+            TRACE_INFO(_L("Requesting Signal strength"));
+            LEAVE_IF_ERROR(params.Append(TATParam(iPhoneStatus->GetRssiStrength())))
+            LEAVE_IF_ERROR(params.Append(TATParam(KBerUnknown)))
+            code = CATResult::NewL(EATCSQ, EATActionResult, &params);
+            TRACE_INFO(_L("done"));
+            break;
+            }
+        case EATCGMI:
+            {
+            TBuf8<RMobilePhone::KPhoneManufacturerIdSize> buf;
+            buf.Copy(iIdentity.iManufacturer);
+            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
+            code = CATResult::NewL(EATCGMI, EATActionResult, &params);
+            break;
+            }
+        case EATCGMM:
+            {
+            TBuf8<RMobilePhone::KPhoneModelIdSize> buf;
+            buf.Copy(iIdentity.iModel);
+            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
+            code = CATResult::NewL(EATCGMM, EATActionResult, &params);
+            break;      
+            }
+        case EATCGMR:
+            {
+            TBuf8<RMobilePhone::KPhoneRevisionIdSize> buf;
+            buf.Copy(iIdentity.iRevision);
+            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
+            code = CATResult::NewL(EATCGMR, EATActionResult, &params);
+            break;      
+            }
+        case EATCIMI:
+            {
+            iEtelQuery->SetServiceId(KQueryIMSI);
+            iPhone.GetSubscriberId(iEtelQuery->iStatus, iId);
+            iEtelQuery->GoActive();
+            break;
+            }
         case EATCGSN:
             {
-            CATResult* code = NULL;
-            RATResultPtrArray resarr;
-            ATObjArrayCleanupResetAndDestroyPushL(resarr);              
-            RATParamArray params;
-            CleanupClosePushL(params);
             TBuf8<RMobilePhone::KPhoneSerialNumberSize> buf;
             buf.Copy(iIdentity.iSerialNumber);
             LEAVE_IF_ERROR(params.Append(TATParam(buf)))
             code = CATResult::NewL(EATCGSN, EATActionResult, &params);
-            CleanupStack::PopAndDestroy(&params);
-            CleanupStack::PushL(code);
-            resarr.AppendL(code);
-            CleanupStack::Pop(code);
-            CATResult* ok = CATResult::NewL(EATOK);
-            CleanupStack::PushL(ok);
-            resarr.AppendL(ok);
-            CleanupStack::Pop(ok);
-            SendResponseL(resarr);
-            CleanupStack::PopAndDestroy(&resarr);
-            CmdHandlingCompletedL();
             break;
             }
         default:
             LEAVE(KErrNotSupported);
+        }    
+    CleanupStack::PopAndDestroy(&params);
+    if (code)
+        {
+        CleanupStack::PushL(code);
+        resarr.AppendL(code);
+        CleanupStack::Pop(code);
+        CATResult* ok = CATResult::NewL(EATOK);
+        CleanupStack::PushL(ok);
+        resarr.AppendL(ok);
+        CleanupStack::Pop(ok);
+        SendResponseL(resarr);
+        CmdHandlingCompletedL();
         }
+    CleanupStack::PopAndDestroy(&resarr);
     }
 
 void CBtmcProtocol::DoSendProtocolDataL()