00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00025 #include "CMsgQActive.h"
00026 #include "e32cons.h"
00027
00028 _LIT(KCommonFormat2,"%S");
00029 _LIT(KTitle , "OutputMessage");
00030
00034 CMsgQActive::CMsgQActive(TInt aPriority):CActive(aPriority)
00035 {
00036 CActiveScheduler::Add( this );
00037 }
00038
00039
00040 CMsgQActive* CMsgQActive::NewL(TInt aPriority)
00041 {
00042 CMsgQActive* self=new(ELeave)CMsgQActive(aPriority);
00043 CleanupStack::PushL(self);
00044 self->ConstructL();
00045 CleanupStack::Pop(self);
00046 return self;
00047 }
00048
00052 void CMsgQActive::ConstructL()
00053 {
00054 iConsole = Console::NewL(KTitle, TSize(KConsFullScreen, KConsFullScreen));
00055 _LIT(KWelcomeScreen,".......Words recieved from the inverter......\n");
00056 iConsole->Printf(KWelcomeScreen);
00057
00058
00059 _LIT(KGlobalInverterOutQ, "InverterOutQ");
00060 User::LeaveIfError(iInverterOutQ.OpenGlobal(KGlobalInverterOutQ));
00061 }
00062
00067 void CMsgQActive::StartRecieving()
00068 {
00069 iInverterOutQ.NotifyDataAvailable(iStatus);
00070 SetActive();
00071 }
00072
00073 CMsgQActive::~CMsgQActive()
00074 {
00075 }
00076
00080 void CMsgQActive::DoCancel()
00081 {
00082
00083 iInverterOutQ.CancelDataAvailable();
00084 delete iConsole;
00085 }
00086
00091 void CMsgQActive::RunL()
00092 {
00093
00094 iInverterOutQ.ReceiveBlocking(imsgQData);
00095
00096
00097 iConsole->Printf(KCommonFormat2,&imsgQData);
00098
00099 _LIT(KNextLine , "\n");
00100 iConsole->Printf(KNextLine);
00101
00102
00103 iInverterOutQ.NotifyDataAvailable(iStatus);
00104 SetActive();
00105 }