<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - CTimer problem  - Comments</title>
 <link>http://www.newlc.com/forum/ctimer-problem-0</link>
 <description>Comments for &quot;CTimer problem &quot;</description>
 <language>en</language>
<item>
 <title>Re: CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0#comment-46257</link>
 <description>&lt;p&gt;Great , That is what I thought, &lt;br /&gt;
Thank you very much for your help!&lt;/p&gt;</description>
 <pubDate>Thu, 08 May 2008 14:44:17 +0200</pubDate>
 <dc:creator>Bill_Murray</dc:creator>
 <guid isPermaLink="false">comment 46257 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0#comment-46238</link>
 <description>&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;// CA.h&lt;br /&gt;class CB;&lt;br /&gt;&lt;br /&gt;class CA : public CActive {&lt;br /&gt;...&lt;br /&gt;public:&lt;br /&gt;&amp;nbsp;&amp;nbsp; void DoBeDoBeDooL();&lt;br /&gt;...&lt;br /&gt;private:&lt;br /&gt;&amp;nbsp; CB * iB;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;// CB.h&lt;br /&gt;class CB : public CActive {&lt;br /&gt;...&lt;br /&gt;public:&lt;br /&gt;&amp;nbsp;&amp;nbsp; void DamDiDamDiDamL();&lt;br /&gt;...&lt;br /&gt;private:&lt;br /&gt;&amp;nbsp; RTimer iTimer;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;//CA.cpp&lt;br /&gt;...&lt;br /&gt;void CA::DoBeDoBeDooL()&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp; iB-&amp;gt;DamDiDamDiDamL();&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;// CB.cpp&lt;br /&gt;void CB::DamDiDamDIDamL()&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp; iTimer.After(iStatus, 1000000);&lt;br /&gt;&amp;nbsp;&amp;nbsp; SetActive();&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Wed, 07 May 2008 19:42:32 +0200</pubDate>
 <dc:creator>Andreas</dc:creator>
 <guid isPermaLink="false">comment 46238 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0#comment-46230</link>
 <description>&lt;p&gt;The same way any other class would communicate to it, by storing a pointer or reference to the object and call a member function on it.&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Wed, 07 May 2008 15:15:21 +0200</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 46230 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0#comment-46227</link>
 <description>&lt;p&gt;Hi Andreas&lt;br /&gt;
Thank you for the info.&lt;br /&gt;
Please advise,&lt;br /&gt;
what would be a good to communicate between 2 active objects? how can one object &quot;tell&quot; another objects to start a specific async request?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
 <pubDate>Wed, 07 May 2008 14:15:18 +0200</pubDate>
 <dc:creator>Bill_Murray</dc:creator>
 <guid isPermaLink="false">comment 46227 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0#comment-46146</link>
 <description>&lt;p&gt;Splitting the code means design -- design your classes to handle (optimally) only one thing per class. This is a good object oriented design heuristic. In practice, you can sometimes overlook this heuristic. So in your case let one active object handle one asynchronous service and implement another active object to handle some other asynchronous service.&lt;/p&gt;</description>
 <pubDate>Sun, 04 May 2008 19:20:11 +0200</pubDate>
 <dc:creator>Andreas</dc:creator>
 <guid isPermaLink="false">comment 46146 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0#comment-46082</link>
 <description>&lt;p&gt;Thank you both very much&lt;/p&gt;

&lt;p&gt;Can you please explain what you mean by &quot;splitting the code&quot;?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
 <pubDate>Tue, 29 Apr 2008 23:24:58 +0200</pubDate>
 <dc:creator>Bill_Murray</dc:creator>
 <guid isPermaLink="false">comment 46082 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0#comment-46077</link>
 <description>&lt;p&gt;You shouldn&#039;t call User::WaitForRequest in RunL -- the AO framework (specifically, the CActiveScheduler) will do the waiting and call your RunL when the async request has been finished. Read a tutorial on using active objects, e.g. this: &lt;a href=&quot;http://developer.symbian.com/main/downloads/papers/CActiveAndFriends/CActiveAndFriends.pdf&quot;&gt;http://developer.symbian.com/main/downloads/papers/CActiveAndFriends/CActiveAndFriends.pdf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also follow alh&#039;s suggestion to Keep It Simple Sir.&lt;/p&gt;</description>
 <pubDate>Tue, 29 Apr 2008 17:00:33 +0200</pubDate>
 <dc:creator>Andreas</dc:creator>
 <guid isPermaLink="false">comment 46077 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0#comment-46076</link>
 <description>&lt;p&gt;I would try splitting code up some, and not try to handle everything in the same CActive.&lt;br /&gt;
Trying to handle more then one kind of request in the same active object often gives weird and wonderful problems.&lt;/p&gt;

&lt;p&gt;I would expect this second code block to work though (and also User::After), or at least not produce as weird results as you describe...&lt;/p&gt;

&lt;p&gt;Sorry, don&#039;t think I can help much more then that...&lt;/p&gt;</description>
 <pubDate>Tue, 29 Apr 2008 16:53:05 +0200</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 46076 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0#comment-46074</link>
 <description>&lt;p&gt;Thank you for your reply alh&lt;/p&gt;

&lt;p&gt;The iTimeouttimer  inherits CTimer.&lt;/p&gt;

&lt;p&gt;I tried to use RTimer also, this way (iTimer is a RTimer):&lt;br /&gt;
&lt;pre class=&quot;bb-code-block&quot;&gt;//### INSIDE CActive::RunL() - WHEN CALL STATUS IS CONNECTED ###
while(dtmfIndex&amp;lt;DTMF_Buf-&amp;gt;Length())
{
  if tone is &#039;p&#039;
  {
    dtmfIndex++;
    iTimer.After(iStatus,2000000);//2 sec delay
    User::WaitForRequest(iStatus);
  }
  else
  {
    iPhone.StartDTMFTone((DTMF_Buf-&amp;gt;Des())[dtmfIndex]);
    dtmfIndex++;
    iPhone.StopDTMFTone();
    iTimer.After(iStatus,100000);//very short delay between DTMF&#039;s
    User::WaitForRequest(iStatus);
  }
}&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;I also tried User::After instead of iTimer.After.&lt;/p&gt;

&lt;p&gt;The result was that the delay was much shorter than 2 seconds and further more - the rest of the DTMF&#039;s after the delay were not equal in their length and the short delay between them.&lt;/p&gt;

&lt;p&gt;If you can suggest me a better way to do this, I&#039;ll be happy to hear about it !&lt;/p&gt;

&lt;p&gt;Thank you very much &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;/p&gt;</description>
 <pubDate>Tue, 29 Apr 2008 15:01:17 +0200</pubDate>
 <dc:creator>Bill_Murray</dc:creator>
 <guid isPermaLink="false">comment 46074 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0#comment-46059</link>
 <description>&lt;p&gt;are you really sure your timeout timer works at all?&lt;/p&gt;

&lt;p&gt;Are you sure the delay isn&#039;t inside any of those dtmf functions or the line status?&lt;/p&gt;

&lt;p&gt;to me that code looks a bit funky...  what is the thought there?&lt;/p&gt;

&lt;p&gt;If you have a active object that wants to send dtmf tones on some interval with the help of some timer, I would expect the runl to send new requests to the timer, but here you do some kind of request on an external timer, and then issue a request to the line status...&lt;br /&gt;
so next call to runl will not be when the timer times out, but when the line status request completes...&lt;/p&gt;

&lt;p&gt;what is that iTimeouttimer and how is it supposed to work?&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Mon, 28 Apr 2008 17:03:33 +0200</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 46059 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0#comment-46053</link>
 <description>&lt;p&gt;Thanks Andreas I will keep that in mind.&lt;/p&gt;

&lt;p&gt;If I&#039;ll put this code (below) inside the TimerExpired() method, do you think it would be ok?&lt;br /&gt;
&lt;pre class=&quot;bb-code-block&quot;&gt;
//if tone is &quot;p&quot; (pause)
  {
    dtmfIndex++;
    TTimeIntervalMicroSeconds32 interval = 2000000;// 2 seconds
    iTimeOutTimer-&amp;gt;After(interval);	
  }
  else // tone is numeric
  {
    iPhone.StartDTMFTone((DTMF_Buf-&amp;gt;Des())[dtmfIndex]);// send DTMF
    dtmfIndex++;
    iPhone.StopDTMFTone();
    TTimeIntervalMicroSeconds32 interval = 100000;
    iTimeOutTimer-&amp;gt;After(interval);
  }&lt;/pre&gt;&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Mon, 28 Apr 2008 13:59:11 +0200</pubDate>
 <dc:creator>Bill_Murray</dc:creator>
 <guid isPermaLink="false">comment 46053 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0#comment-46041</link>
 <description>&lt;p&gt;What worries me is that you call RunL yourself -- something you should never do. Only the scheduler calls the RunL, when the async operation has been done.&lt;/p&gt;</description>
 <pubDate>Sun, 27 Apr 2008 21:59:03 +0200</pubDate>
 <dc:creator>Andreas</dc:creator>
 <guid isPermaLink="false">comment 46041 at http://www.newlc.com</guid>
</item>
<item>
 <title>CTimer problem </title>
 <link>http://www.newlc.com/forum/ctimer-problem-0</link>
 <description>&lt;p&gt;Hi&lt;br /&gt;
On S60 3rd edition:&lt;br /&gt;
I send DTMF&#039;s during a voice call (which I initiate) using RMobilePhone::StartDTMFTone().&lt;br /&gt;
between each DTMF I call CTimer::After() in order to make a delay between DTMF&#039;s. the TimerExpired() method calls CActive::RunL() again and another DTMF is started.&lt;br /&gt;
The problem occures when I want to create a delay without sending DTMF (like a pause) ,&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/forum/ctimer-problem-0&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/forum/ctimer-problem-0#comments</comments>
 <category domain="http://www.newlc.com/forums/symbian-c">Symbian C++</category>
 <pubDate>Sun, 27 Apr 2008 16:22:28 +0200</pubDate>
 <dc:creator>Bill_Murray</dc:creator>
 <guid isPermaLink="false">20814 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
