connectivitylayer/isce/isaaccessextension_dll/src/indicationhandler.cpp
changeset 5 8ccc39f9d787
parent 0 63b37f68c1ce
equal deleted inserted replaced
4:510c70acdbf6 5:8ccc39f9d787
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 
    19 
    20 #ifndef NCP_COMMON_BRIDGE_FAMILY
       
    21 #include <cmisi.h>                      // PN_COMMMG, PNS_SUBSCRIBED_RESOURCES_...
       
    22 #else
       
    23 #include <pn_eventmodem_extisi.h>       // PNS_SUBSCRIBED_RESOURCES_EXTEND_IND_...
    20 #include <pn_eventmodem_extisi.h>       // PNS_SUBSCRIBED_RESOURCES_EXTEND_IND_...
    24 #endif
       
    25 #include <phonetisi.h>                  // For ISI_HEADER_SIZE
    21 #include <phonetisi.h>                  // For ISI_HEADER_SIZE
    26 #include <pn_const.h>                   // For PN_HEADER_SIZE
    22 #include <pn_const.h>                   // For PN_HEADER_SIZE
    27 #ifndef NCP_COMMON_BRIDGE_FAMILY
       
    28 #include <mediaisi.h>                   // For PNS_MEDIA_SOS
       
    29 #endif
       
    30 #include "indicationhandler.h"
    23 #include "indicationhandler.h"
    31 #include "iadtrace.h"                   // For C_TRACE..
    24 #include "iadtrace.h"                   // For C_TRACE..
    32 #include "router.h"                     // For DRouter
    25 #include "router.h"                     // For DRouter
    33 #include "iadhelpers.h"
    26 #include "iadhelpers.h"
    34 #include "OstTraceDefinitions.h"
    27 #include "OstTraceDefinitions.h"
    76     const TUint8 KPnMsgExtendedSubType( 10 );
    69     const TUint8 KPnMsgExtendedSubType( 10 );
    77     TUint8* ptr = const_cast<TUint8*>( aIndication.Ptr() );
    70     TUint8* ptr = const_cast<TUint8*>( aIndication.Ptr() );
    78     TUint32 resourceId( 0x00000000 );
    71     TUint32 resourceId( 0x00000000 );
    79     if( ptr[ ISI_HEADER_OFFSET_RESOURCEID ] == PN_PREFIX )
    72     if( ptr[ ISI_HEADER_OFFSET_RESOURCEID ] == PN_PREFIX )
    80         {
    73         {
    81 #ifdef NCP_COMMON_BRIDGE_FAMILY
    74         TRACE_ASSERT_ALWAYS;// indications PN_PREFIX defined to PN_COMMGR see iscnokiadefinitions.h
    82         TRACE_ASSERT_ALWAYS;// So called "perävalotakuu" for indications PN_PREFIX defined to PN_COMMGR see iscnokiadefinitions.h
       
    83 #endif
       
    84         C_TRACE( ( _T( "DIndicationHandler::Multicast PN_PREFIX 0x%x" ), &aIndication ) );
    75         C_TRACE( ( _T( "DIndicationHandler::Multicast PN_PREFIX 0x%x" ), &aIndication ) );
    85         OstTrace1( TRACE_NORMAL, DINDICATIONHANDLER_MULTICAST_PN_PREFIX, "DIndicationHandler::Multicast extended resource;aIndication=%x", (TUint)&(aIndication) );
    76         OstTrace1( TRACE_NORMAL, DINDICATIONHANDLER_MULTICAST_PN_PREFIX, "DIndicationHandler::Multicast extended resource;aIndication=%x", (TUint)&(aIndication) );
    86         
    77         
    87         ASSERT_RESET_ALWAYS( aIndication.Length() > KPnMsgExtendedType , EIADOverTheLimits | EIADFaultIdentifier40 << KFaultIdentifierShift );                                                
    78         ASSERT_RESET_ALWAYS( aIndication.Length() > KPnMsgExtendedType , EIADOverTheLimits | EIADFaultIdentifier40 << KFaultIdentifierShift );                                                
    88         resourceId = ( ptr [ KPnMsgExtendedSubType ] << 16 ) + ( ptr [ KPnMsgExtendedType ] << 8 ) +  ( PN_PREFIX );
    79         resourceId = ( ptr [ KPnMsgExtendedSubType ] << 16 ) + ( ptr [ KPnMsgExtendedType ] << 8 ) +  ( PN_PREFIX );
   498     // TODO: Assertion to somewhere else?
   489     // TODO: Assertion to somewhere else?
   499     TDes8& desPtr =  iRouter.AllocateBlock( KSubsriptionLength );
   490     TDes8& desPtr =  iRouter.AllocateBlock( KSubsriptionLength );
   500     ASSERT_RESET_ALWAYS( KSubsriptionLength > ( ISI_HEADER_SIZE + PNS_SUBSCRIBED_RESOURCES_EXTEND_IND_OFFSET_RESOURCECOUNT ) , EIADOverTheLimits | EIADFaultIdentifier42 << KFaultIdentifierShift );                                                        	
   491     ASSERT_RESET_ALWAYS( KSubsriptionLength > ( ISI_HEADER_SIZE + PNS_SUBSCRIBED_RESOURCES_EXTEND_IND_OFFSET_RESOURCECOUNT ) , EIADOverTheLimits | EIADFaultIdentifier42 << KFaultIdentifierShift );                                                        	
   501 
   492 
   502     TUint8* ptr( const_cast<TUint8*>( desPtr.Ptr() ) );
   493     TUint8* ptr( const_cast<TUint8*>( desPtr.Ptr() ) );
   503 #ifndef NCP_COMMON_BRIDGE_FAMILY
       
   504     ptr[ ISI_HEADER_OFFSET_MEDIA ] = PN_MEDIA_SOS;
       
   505 #else
       
   506     ptr[ ISI_HEADER_OFFSET_MEDIA ] = PN_MEDIA_MODEM_HOST_IF;
   494     ptr[ ISI_HEADER_OFFSET_MEDIA ] = PN_MEDIA_MODEM_HOST_IF;
   507 #endif
       
   508     SET_RECEIVER_DEV( ptr, OTHER_DEVICE_1 );
   495     SET_RECEIVER_DEV( ptr, OTHER_DEVICE_1 );
   509     SET_SENDER_DEV( ptr, THIS_DEVICE );
   496     SET_SENDER_DEV( ptr, THIS_DEVICE );
   510     ptr[ ISI_HEADER_OFFSET_RESOURCEID ] = PN_COMMGR;
   497     ptr[ ISI_HEADER_OFFSET_RESOURCEID ] = PN_COMMGR;
   511     SET_RECEIVER_OBJ( ptr, PN_OBJ_ROUTER );
   498     SET_RECEIVER_OBJ( ptr, PN_OBJ_ROUTER );
   512 
   499