datacommsserver/esockserver/test/providers/dummy/inc/dummypr_connprov.h
branchRCL_3
changeset 18 9644881fedd0
parent 17 9ddb1d67ebaf
child 21 07656293a99c
equal deleted inserted replaced
17:9ddb1d67ebaf 18:9644881fedd0
    24 #if !defined(__DummyCPR_CONNPROV_H__)
    24 #if !defined(__DummyCPR_CONNPROV_H__)
    25 #define __DummyCPR_CONNPROV_H__
    25 #define __DummyCPR_CONNPROV_H__
    26 
    26 
    27 #include <comms-infras/mobilitycpr.h>
    27 #include <comms-infras/mobilitycpr.h>
    28 #include <comms-infras/mobilitycprstates.h>
    28 #include <comms-infras/mobilitycprstates.h>
    29 
    29 #include <elements/mm_activities_internal.h> 
    30 
    30 
    31 #ifdef __FLOG_ACTIVE
    31 #ifdef __FLOG_ACTIVE
    32 // CommsDebugUtility logging tags. Use them to enable tracing for DummyCPR
    32 // CommsDebugUtility logging tags. Use them to enable tracing for DummyCPR
    33 _LIT8(KTestDummyLogTag1,"TestDummyConnProv");
    33 _LIT8(KTestDummyLogTag1,"TestDummyConnProv");
    34 _LIT8(KTestDummyLogTag2,"TestDummyRef");
    34 _LIT8(KTestDummyLogTag2,"TestDummyRef");
    35 #endif
    35 #endif
       
    36 
       
    37 enum TCFNodeActivityId
       
    38     {
       
    39     ECFActivityDummyCprDestroy                 = ESock::ECFActivityCustom +1,
       
    40     };
       
    41 
    36 
    42 
    37 class CDummyConnectionProvider : public CMobilityConnectionProvider, public ESock::MLegacyControlApiExt,
    43 class CDummyConnectionProvider : public CMobilityConnectionProvider, public ESock::MLegacyControlApiExt,
    38                                  public ITFHIERARCHY_LINK_1(CDummyConnectionProvider, CMobilityConnectionProvider, ESock::MLegacyControlApiExt)
    44                                  public ITFHIERARCHY_LINK_1(CDummyConnectionProvider, CMobilityConnectionProvider, ESock::MLegacyControlApiExt)
    39 
    45 
    40 /**
    46 /**
    65     
    71     
    66 public:
    72 public:
    67 	TConnType iConnStatus;
    73 	TConnType iConnStatus;
    68     };
    74     };
    69 
    75 
       
    76 
       
    77 class CDelayTimer: public CTimer
       
    78     {
       
    79 public:
       
    80     static CDelayTimer* NewL( Messages::RNodeInterface* aSender, const Messages::TNodeId& aRecipient, const Messages::TNodeSignal::TMessageId& aMessageId );
       
    81 
       
    82     virtual ~CDelayTimer();
       
    83     void Start( TInt aIntervalInSecs );    
       
    84 
       
    85 public:
       
    86 class TDelayMessage : public Messages::TSignatureBase
       
    87     {
       
    88 public:
       
    89     TDelayMessage();
       
    90     TDelayMessage(const TNodeSignal::TMessageId& aMessageId);
       
    91     };
       
    92 
       
    93 private:
       
    94     CDelayTimer( Messages::RNodeInterface* aSender, const Messages::TNodeId& aRecipient, const Messages::TNodeSignal::TMessageId& aMessageId );
       
    95     void ConstructL();
       
    96     
       
    97 protected: // From CTimer (CActive)
       
    98     void RunL();
       
    99         
       
   100 private:
       
   101     Messages::RNodeInterface* iSender;
       
   102     Messages::TNodeId iRecipient;
       
   103     Messages::TNodeSignal::TMessageId iMessageId;
       
   104     };
       
   105 
       
   106 
    70 //-================================================
   107 //-================================================
    71 //
   108 //
    72 // States and Transitions
   109 // States and Transitions
    73 //
   110 //
    74 //-================================================
   111 //-================================================
    86 
   123 
    87 DECLARE_SMELEMENT_HEADER( TAwaitingStart, MeshMachine::TState<TContext>, NetStateMachine::MState, DummyCPRStates::TContext )
   124 DECLARE_SMELEMENT_HEADER( TAwaitingStart, MeshMachine::TState<TContext>, NetStateMachine::MState, DummyCPRStates::TContext )
    88 	virtual TBool Accept();
   125 	virtual TBool Accept();
    89 DECLARE_SMELEMENT_FOOTER( TAwaitingStart )
   126 DECLARE_SMELEMENT_FOOTER( TAwaitingStart )
    90 
   127 
       
   128 DECLARE_SMELEMENT_HEADER( TAwaitingDestroy, MeshMachine::TState<TContext>, NetStateMachine::MState, DummyCPRStates::TContext )
       
   129     virtual TBool Accept();
       
   130 DECLARE_SMELEMENT_FOOTER( TAwaitingDestroy )
       
   131 
       
   132 DECLARE_SMELEMENT_HEADER( TThreeSecDelayAndPostToSelf, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, DummyCPRStates::TContext )
       
   133     virtual void DoL();
       
   134 DECLARE_SMELEMENT_FOOTER( TThreeSecDelayAndPostToSelf )
    91 
   135 
    92 } // namespace DummyCPRStates
   136 } // namespace DummyCPRStates
    93 
   137 
    94 #endif // __DummyCPR_CONNPROV_H__
   138 #endif // __DummyCPR_CONNPROV_H__
    95 
   139