bluetoothengine/btsap/src/BTSapSocketStateSend.cpp
changeset 0 f63038272f30
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2004 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 "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 *     This class is a BTSapSocketHandler's state for sending incoming SAP connection
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "BTSapSocketHandler.h"
       
    22 #include "debug.h"
       
    23 
       
    24 CBTSapSocketHandler::TStateSend::TStateSend(RSocket& aSocket)
       
    25     : TState(aSocket)
       
    26     {
       
    27     }
       
    28 
       
    29 // ---------------------------------------------------------
       
    30 // Enter
       
    31 // ---------------------------------------------------------
       
    32 void CBTSapSocketHandler::TStateSend:: Enter(TRequestStatus& aStatus)
       
    33     {
       
    34     BTSAP_TRACE_OPT(KBTSAP_TRACE_STM, BTSapPrintTrace(_L("[BTSap]  CBTSapSocketHandler::TStateSend: Enter: msg size: %d"), iResponseData.Length()));
       
    35 
       
    36     iSocket.Write(iResponseData, aStatus);
       
    37     BTSAP_TRACE_OPT(KBTSAP_TRACE_INFO, BTSapPrintHex(_L8("[BTSap]  Send: %S"), &iResponseData));
       
    38     }
       
    39 
       
    40 // --------------------------------------------------------------------------------------------
       
    41 // Complete
       
    42 // set next state
       
    43 // --------------------------------------------------------------------------------------------
       
    44 //
       
    45 TBTSapSocketState CBTSapSocketHandler::TStateSend::Complete(TInt /*aReason*/)
       
    46     {
       
    47     BTSAP_TRACE_OPT(KBTSAP_TRACE_STM, BTSapPrintTrace(_L("[BTSap]  CBTSapSocketHandler::TStateSend: Complete")));
       
    48 
       
    49     return EBTSapSocketStateRecv;
       
    50     }
       
    51 
       
    52 void CBTSapSocketHandler::TStateSend::Cancel()
       
    53     {
       
    54     BTSAP_TRACE_OPT(KBTSAP_TRACE_STM, BTSapPrintTrace(_L("[BTSap]  CBTSapSocketHandler::TStateSend: Cancel")));
       
    55 
       
    56     iSocket.CancelSend();
       
    57     }
       
    58 
       
    59 void CBTSapSocketHandler::TStateSend::SetResponseData(const TDesC8& aResponseData)
       
    60     {
       
    61     iResponseData = aResponseData;
       
    62     }
       
    63 
       
    64 //  End of File