connectivitylayer/isimessage/isimessage_dll/src/tisi.cpp
changeset 6 942573423a60
parent 5 8ccc39f9d787
child 8 6295dc2169f3
equal deleted inserted replaced
5:8ccc39f9d787 6:942573423a60
   552     TUint16 calcFinalLength( TUint16( iFinalLength - KMessageHeaderLength ) );
   552     TUint16 calcFinalLength( TUint16( iFinalLength - KMessageHeaderLength ) );
   553 
   553 
   554     C_TRACE( ( _T ( "TIsiSend::Complete, length: 0x%x, calcfinallength: 0x%x" ), length, calcFinalLength ) );
   554     C_TRACE( ( _T ( "TIsiSend::Complete, length: 0x%x, calcfinallength: 0x%x" ), length, calcFinalLength ) );
   555     OstTraceExt2( TRACE_NORMAL, DUP1_TISISEND_COMPLETE, "TIsiSend::Complete;length=%hu;calcFinalLength=%hu", length, calcFinalLength );
   555     OstTraceExt2( TRACE_NORMAL, DUP1_TISISEND_COMPLETE, "TIsiSend::Complete;length=%hu;calcFinalLength=%hu", length, calcFinalLength );
   556     
   556     
   557     if( iFinalLength == 0 )    // TIsiSend alternative constructor used
   557     #if defined( __WINS__ ) || defined( __WINSCW__ )
   558        {
   558         {
   559            TUint8 byte1 = ( TUint8 )( ( length & 0xff00 ) >> 8 );
   559          if( iFinalLength == 0 )    // TIsiSend alternative constructor used
   560            TUint8 byte2 = ( TUint8 )( length & 0x00ff );        
   560             {
   561            this->Set8bit( ISI_HEADER_OFFSET_LENGTH, byte1 );        // BE
   561                 TUint8 byte1 = ( TUint8 )( ( length & 0xff00 ) >> 8 );
   562            this->Set8bit( ISI_HEADER_OFFSET_LENGTH + 1, byte2 );    // BE
   562                 TUint8 byte2 = ( TUint8 )( length & 0x00ff );        
   563        }
   563                 this->Set8bit( ISI_HEADER_OFFSET_LENGTH, byte1 );        // BE
   564     else
   564                 this->Set8bit( ISI_HEADER_OFFSET_LENGTH + 1, byte2 );    // BE
   565        {
   565             }
   566            TUint8 byte1 = ( TUint8 )( ( calcFinalLength & 0xff00 ) >> 8 );
   566          else
   567            TUint8 byte2 = ( TUint8 )( calcFinalLength & 0x00ff );        
   567             {
   568            this->Set8bit( ISI_HEADER_OFFSET_LENGTH, byte1 );        // BE
   568                 TUint8 byte1 = ( TUint8 )( ( calcFinalLength & 0xff00 ) >> 8 );
   569            this->Set8bit( ISI_HEADER_OFFSET_LENGTH + 1, byte2 );    // BE               
   569                 TUint8 byte2 = ( TUint8 )( calcFinalLength & 0x00ff );        
   570            iBuffer.SetLength( iFinalLength );
   570                 this->Set8bit( ISI_HEADER_OFFSET_LENGTH, byte1 );        // BE
   571        }
   571                 this->Set8bit( ISI_HEADER_OFFSET_LENGTH + 1, byte2 );    // BE               
       
   572                 iBuffer.SetLength( iFinalLength );
       
   573             }
       
   574         }
       
   575     #else
       
   576         {
       
   577          if( iFinalLength == 0 )    // TIsiSend alternative constructor used
       
   578                 {
       
   579                 TUint8 byte1 = ( TUint8 )( ( length & 0xff00 ) >> 8 );
       
   580                 TUint8 byte2 = ( TUint8 )( length & 0x00ff );        
       
   581                 this->Set8bit( ISI_HEADER_OFFSET_LENGTH, byte2 );        // LE
       
   582                 this->Set8bit( ISI_HEADER_OFFSET_LENGTH + 1, byte1 );    // LE
       
   583                 }
       
   584             else
       
   585                 {
       
   586                 TUint8 byte1 = ( TUint8 )( ( calcFinalLength & 0xff00 ) >> 8 );
       
   587                 TUint8 byte2 = ( TUint8 )( calcFinalLength & 0x00ff );        
       
   588                 this->Set8bit( ISI_HEADER_OFFSET_LENGTH, byte2 );        // LE
       
   589                 this->Set8bit( ISI_HEADER_OFFSET_LENGTH + 1, byte1 );    // LE               
       
   590                 iBuffer.SetLength( iFinalLength );
       
   591                 }
       
   592         }
       
   593     #endif    
   572 
   594 
   573     C_TRACE( ( _T ( "TIsiSend::Complete, byte2: 0x%x, byte1: 0x%x" ), iBuffer[5], iBuffer[4] ) );
   595     C_TRACE( ( _T ( "TIsiSend::Complete, byte2: 0x%x, byte1: 0x%x" ), iBuffer[5], iBuffer[4] ) );
   574     OstTraceExt2( TRACE_NORMAL, DUP2_TISISEND_COMPLETE, "TIsiSend::Complete;byte2=%hhu;byte1=%hhu", iBuffer[5], iBuffer[4] );
   596     OstTraceExt2( TRACE_NORMAL, DUP2_TISISEND_COMPLETE, "TIsiSend::Complete;byte2=%hhu;byte1=%hhu", iBuffer[5], iBuffer[4] );
   575     
   597     
   576     C_TRACE( ( _L ( "TIsiSend::Complete - return, buffer length = 0x%x, iFinalLength = 0x%x" ), length, iFinalLength ) );
   598     C_TRACE( ( _L ( "TIsiSend::Complete - return, buffer length = 0x%x, iFinalLength = 0x%x" ), length, iFinalLength ) );