datacommsserver/esockserver/test/providers/dummy/inc/dummypr_connprov.h
changeset 40 34fc115b8742
parent 0 dfb7c4ff071f
child 65 41cc8e7ff496
equal deleted inserted replaced
34:6646e488a904 40:34fc115b8742
    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 /**
    57          EConnIncoming = 1,
    63          EConnIncoming = 1,
    58          EConnNoIncoming = 2,
    64          EConnNoIncoming = 2,
    59          };
    65          };
    60 
    66 
    61     static CDummyConnectionProvider* NewL(ESock::CConnectionProviderFactoryBase& aFactory, TConnType aConnStatus);
    67     static CDummyConnectionProvider* NewL(ESock::CConnectionProviderFactoryBase& aFactory, TConnType aConnStatus);
    62     CDummyConnectionProvider(ESock::CConnectionProviderFactoryBase& aFactory, TConnType aConnStatus);
    68     static CDummyConnectionProvider* NewVanillaL(ESock::CConnectionProviderFactoryBase& aFactory);
       
    69     
       
    70     CDummyConnectionProvider(ESock::CConnectionProviderFactoryBase& aFactory, const MeshMachine::TNodeActivityMap& aActivityMap, TConnType aConnStatus);
       
    71     
    63 public:
    72 public:
    64 	TConnType iConnStatus;
    73 	TConnType iConnStatus;
    65     };
    74     };
       
    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 
    66 
   106 
    67 //-================================================
   107 //-================================================
    68 //
   108 //
    69 // States and Transitions
   109 // States and Transitions
    70 //
   110 //
    83 
   123 
    84 DECLARE_SMELEMENT_HEADER( TAwaitingStart, MeshMachine::TState<TContext>, NetStateMachine::MState, DummyCPRStates::TContext )
   124 DECLARE_SMELEMENT_HEADER( TAwaitingStart, MeshMachine::TState<TContext>, NetStateMachine::MState, DummyCPRStates::TContext )
    85 	virtual TBool Accept();
   125 	virtual TBool Accept();
    86 DECLARE_SMELEMENT_FOOTER( TAwaitingStart )
   126 DECLARE_SMELEMENT_FOOTER( TAwaitingStart )
    87 
   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 )
    88 
   135 
    89 } // namespace DummyCPRStates
   136 } // namespace DummyCPRStates
    90 
   137 
    91 #endif // __DummyCPR_CONNPROV_H__
   138 #endif // __DummyCPR_CONNPROV_H__
    92 
   139