|
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 BTSapServer's state for setting up connection with BTSap client |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include "BTSapServerState.h" |
|
23 #include "BTSapSocketHandler.h" |
|
24 #include "debug.h" |
|
25 |
|
26 CBTSapServerState::TStateDisconnect::TStateDisconnect(CBTSapServerState& aServerState) |
|
27 : TStateIdle(aServerState) |
|
28 { |
|
29 } |
|
30 |
|
31 // --------------------------------------------------------- |
|
32 // Enter |
|
33 // --------------------------------------------------------- |
|
34 void CBTSapServerState::TStateDisconnect:: Enter(TRequestStatus& aStatus) |
|
35 { |
|
36 BTSAP_TRACE_OPT(KBTSAP_TRACE_STM, BTSapPrintTrace(_L("[BTSap] SM: TStateDisconnect: Enter"))); |
|
37 |
|
38 iStatus = &aStatus; |
|
39 User::RequestComplete(iStatus, KErrNone); |
|
40 } |
|
41 |
|
42 // -------------------------------------------------------------------------------------------- |
|
43 // Complete |
|
44 // set next state |
|
45 // -------------------------------------------------------------------------------------------- |
|
46 // |
|
47 TBTSapServerState CBTSapServerState::TStateDisconnect::Complete(TInt /*aReason*/) |
|
48 { |
|
49 BTSAP_TRACE_OPT(KBTSAP_TRACE_STM, BTSapPrintTrace(_L("[BTSap] SM: TStateDisconnect: Complete"))); |
|
50 |
|
51 iResponseMessage.SetMsgID(EDisconnectResponse); |
|
52 iServerState.BTSapSocketHandler().Send(iResponseMessage.Data()); |
|
53 |
|
54 return EStateNotConnected; |
|
55 } |
|
56 |
|
57 void CBTSapServerState::TStateDisconnect::Cancel() |
|
58 { |
|
59 BTSAP_TRACE_OPT(KBTSAP_TRACE_STM, BTSapPrintTrace(_L("[BTSap] SM: TStateDisconnect: Cancel"))); |
|
60 |
|
61 TStateIdle::Cancel(); |
|
62 } |
|
63 |
|
64 TInt CBTSapServerState::TStateDisconnect::ChangeState(TBTSapServerState& aNextState) |
|
65 { |
|
66 aNextState = EStateDisconnect; |
|
67 return KErrNotSupported; |
|
68 } |
|
69 |
|
70 // End of File |