connectivitylayer/isce/isirouter_dll/inc/isirouter.h
author mikaruus
Tue, 19 Oct 2010 13:16:20 +0300
changeset 9 8486d82aef45
parent 7 fa67e03b87df
permissions -rw-r--r--
modemadaptation release 2010wk40
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     1
/*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     3
* All rights reserved.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     8
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     9
* Initial Contributors:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    11
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    12
* Contributors:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    13
* 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    14
* Description: 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    15
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    16
*/
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    17
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    18
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    19
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    20
#ifndef __ISIROUTER_H__
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    21
#define __ISIROUTER_H__
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    22
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    23
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    24
#include "misilinkrouterif.h"     // For MISILinkRouterIf
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    25
#include "misiobjectrouterif.h"  // For MISIObjectRouterIf
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    26
#include "isiinternaldefs.h"      // For KMaxAmountOfObjId
7
fa67e03b87df New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
    27
//#include "misiobjectrouterif.h"
fa67e03b87df New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
    28
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    29
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    30
class MISIRouterObjectIf;
7
fa67e03b87df New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
    31
class MISIRouterObjectIf;
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    32
class MISIRouterLinkIf;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    33
class DISICLTransceiver;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    34
class DISIThreadContainer;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    35
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    36
/*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    37
* ISI router.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    38
*/
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    39
NONSHARABLE_CLASS( DISIRouter ) : public DBase, public MISIObjectRouterIf
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    40
    {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    41
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    42
    public:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    43
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    44
        /*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    45
        * Default contructor
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    46
        */
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    47
        DISIRouter();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    48
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    49
        /*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    50
        * Destructor
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    51
        */
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    52
        ~DISIRouter();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    53
        
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    54
        //From CLTransceiver
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    55
        TBool Receive( TDes8& aMessage, const TUint8 aObjId );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    56
        
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    57
        /*
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    58
        * See comments from MISIObjectRouterIf
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    59
        */
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    60
        TInt Send( TDes8& aMessage, const TUint8 aObjId );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    61
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    62
        /*
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    63
        * See comments from MISIObjectRouterIf
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    64
        */
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    65
        void Disconnect( const TUint8 aObjId );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    66
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    67
        /*
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    68
        * See comments from MISIObjectRouterIf
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    69
        */
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    70
        TDfcQue* GetDfcThread( const TISIDfcQThreadType aType );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    71
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    72
        void FreeDfcThread( TDfcQue* aThread );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    73
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    74
        /*
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    75
        * See comments from MISIObjectRouterIf
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    76
        */
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    77
        void Connect( const TInt32 aUID, TUint8& aObjId, MISIRouterObjectIf* aCallback );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    78
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    79
        /*
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    80
        * Returns pointer to router it self, called only from MISIObjectRouterIf::GetIf
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    81
        * @return pointer to router.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    82
        */
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    83
        static DISIRouter* GetRouter(){ return iSelfPtr; };
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    84
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    85
    private:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    86
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    87
        NONSHARABLE_CLASS( TISIClient )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    88
            {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    89
            public:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    90
                TInt32                 iUID;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    91
                TUint8                 iObjId;
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    92
                MISIRouterObjectIf*   iChannel;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    93
            };
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
    94
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    95
        NONSHARABLE_CLASS( TStaticId )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    96
            {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    97
            public:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    98
                TStaticId( const TInt32 aUID, TUint8 aObjId ){iUID = aUID; iObjId = aObjId;};
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    99
                TInt32 iUID;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   100
                TUint8 iObjId;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   101
            };
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   102
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   103
    private:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   104
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   105
        /*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   106
        * Handles initialization of this class.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   107
        * Called in own thread context not supervisors
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   108
        */
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   109
        void Initialize();
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   110
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   111
        TBool CheckUIDUniqueness( const TInt32 aUID );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   112
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   113
        TUint8 ReserveStaticObjId( const TInt32 aUID );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   114
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   115
        TUint8 ReserveNewDynamicObjId();
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   116
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   117
        static void InitializeDfc( TAny* aPtr );
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   118
7
fa67e03b87df New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   119
    public:
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   120
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   121
        // Written only once no need to synch.
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   122
        static DISIRouter*   iSelfPtr;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   123
7
fa67e03b87df New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   124
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   125
        DISICLTransceiver* GetDISICLTransceiver(){ return iShCLTransceiver;};
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   126
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   127
    private:
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   128
	
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   129
        // Owned, synchronized internally with fastmutexes.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   130
        RArray< TStaticId* > iStaticObjIdTable;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   131
        // Owned, synchronized internally with fastmutexes.
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   132
        TISIClient*          iClientTable[ KMaxAmountOfObjId ];//  switch this to objects
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   133
        // Guards class shared array, owned
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   134
        NFastMutex*          iClientTableFastMutex;
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   135
        // Owned, executed only from one thread.
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   136
        TDfc*                iInitializeDfc;
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   137
        // Owned, executed only from one thread.
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   138
        TDfcQue*             iInitThread;
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   139
        // Owned, synch done inside the class.
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   140
        DISICLTransceiver*   iShCLTransceiver;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   141
        // Owned, synch done inside the class.
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 7
diff changeset
   142
        DISIThreadContainer* iShClientThreadContainer;
7
fa67e03b87df New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   143
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   144
    };
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   145
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   146
#endif /* __ISIROUTER_H__ */
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   147