localconnectivityservice/dun/utils/src/DunDataPusher.cpp
branchRCL_3
changeset 44 7a45d2ea2f56
parent 40 52a167391590
equal deleted inserted replaced
41:fb2c519f85e0 44:7a45d2ea2f56
   192     if ( retTemp != KErrNone )
   192     if ( retTemp != KErrNone )
   193         {
   193         {
   194         FTRACE(FPrint( _L("CDunDataPusher::SendQueuedData() (ERROR) complete" )));
   194         FTRACE(FPrint( _L("CDunDataPusher::SendQueuedData() (ERROR) complete" )));
   195         return EFalse;
   195         return EFalse;
   196         }
   196         }
   197     iPushState = EDunStateDataPushing;
       
   198     FTRACE(FPrint( _L("CDunDataPusher::SendQueuedData() complete (%d)" ), iEventQueue.Count() ));
   197     FTRACE(FPrint( _L("CDunDataPusher::SendQueuedData() complete (%d)" ), iEventQueue.Count() ));
   199     return ETrue;
   198     return ETrue;
   200     }
   199     }
   201 
   200 
   202 // ---------------------------------------------------------------------------
   201 // ---------------------------------------------------------------------------
   336         }
   335         }
   337     const TDesC8* dataToPush = iEventQueue[iEventIndex].iDataToPush;
   336     const TDesC8* dataToPush = iEventQueue[iEventIndex].iDataToPush;
   338     if ( iComm )
   337     if ( iComm )
   339         {
   338         {
   340         iStatus = KRequestPending;
   339         iStatus = KRequestPending;
       
   340         iPushState = EDunStateDataPushing;
   341         iComm->Write( iStatus, *dataToPush );
   341         iComm->Write( iStatus, *dataToPush );
   342         FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() RComm Write() requested (buffer=0x%08X)" ), dataToPush ));
   342         SetActive();
       
   343         FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() RComm Write() requested for %d bytes... (buffer=0x%08X)" ), dataToPush->Length(), dataToPush ));
   343         }
   344         }
   344     else if ( iSocket )
   345     else if ( iSocket )
   345         {
   346         {
   346         iStatus = KRequestPending;
   347         iStatus = KRequestPending;
       
   348         iPushState = EDunStateDataPushing;
   347         iSocket->Send( *dataToPush, 0, iStatus );
   349         iSocket->Send( *dataToPush, 0, iStatus );
   348         FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() RSocket Send() requested (buffer=0x%08X)" ), dataToPush ));
   350         SetActive();
       
   351         FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() RSocket Send() requested for %d bytes... (buffer=0x%08X)" ), dataToPush->Length(), dataToPush ));
   349         }
   352         }
   350     else
   353     else
   351         {
   354         {
   352         FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() (ERROR) complete" )));
   355         FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() (ERROR) complete" )));
   353         return KErrGeneral;
   356         return KErrGeneral;
   354         }
   357         }
   355     SetActive();
       
   356     FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() complete" )));
   358     FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() complete" )));
   357     return KErrNone;
   359     return KErrNone;
   358     }
   360     }
   359 
   361 
   360 // ---------------------------------------------------------------------------
   362 // ---------------------------------------------------------------------------
   410             iStreamCallback->NotifyDataPushComplete( ETrue );
   412             iStreamCallback->NotifyDataPushComplete( ETrue );
   411             }
   413             }
   412         }  // if ( !stop )
   414         }  // if ( !stop )
   413     else  // stop -> tear down connection
   415     else  // stop -> tear down connection
   414         {
   416         {
       
   417         iPushState = EDunStateIdle;
   415         TDunConnectionReason connReason;
   418         TDunConnectionReason connReason;
   416         connReason.iReasonType = EDunReasonTypeRW;
   419         connReason.iReasonType = EDunReasonTypeRW;
   417         connReason.iContext = EDunMediaContextLocal;
   420         connReason.iContext = EDunMediaContextLocal;
   418         connReason.iSignalType = 0;
   421         connReason.iSignalType = 0;
   419         connReason.iSignalHigh = EFalse;
   422         connReason.iSignalHigh = EFalse;