<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>MQX Software SolutionsのトピックRe: Why the TCPIP_task has two argrument?</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Why-the-TCPIP-task-has-two-argrument/m-p/286804#M9085</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is because TCP/IP task is created by calling function RTCS_task_create() instead of standard MQX _task_create(). RTCS_task_create has following prototype:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;extern uint_32 RTCS_task_create&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; char_ptr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; uint_32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; priority,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; uint_32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stacksize,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; void (_CODE_PTR_&amp;nbsp; start)(pointer, pointer),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; pointer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arg&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see every task created by this function must have two parameters (task parameter and creator). However the TCP/IP task require no parameter so it is called 'dummy' in its definition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Apr 2013 07:28:43 GMT</pubDate>
    <dc:creator>karelm_</dc:creator>
    <dc:date>2013-04-30T07:28:43Z</dc:date>
    <item>
      <title>Why the TCPIP_task has two argrument?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Why-the-TCPIP-task-has-two-argrument/m-p/286803#M9084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am reading RTCS code(MQX4.0), and confused that TCPIP_task has two argrument.&lt;/P&gt;&lt;P&gt;In the rtcs\source\tcpip\tcpip.c:&lt;/P&gt;&lt;P&gt; void TCPIP_task&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointer dummy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointer creatro&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;while all other task, such as shell task has only one argrument.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Apr 2013 08:45:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Why-the-TCPIP-task-has-two-argrument/m-p/286803#M9084</guid>
      <dc:creator>JerryFan</dc:creator>
      <dc:date>2013-04-26T08:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Why the TCPIP_task has two argrument?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Why-the-TCPIP-task-has-two-argrument/m-p/286804#M9085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is because TCP/IP task is created by calling function RTCS_task_create() instead of standard MQX _task_create(). RTCS_task_create has following prototype:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;extern uint_32 RTCS_task_create&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; char_ptr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; uint_32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; priority,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; uint_32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stacksize,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; void (_CODE_PTR_&amp;nbsp; start)(pointer, pointer),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; pointer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arg&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see every task created by this function must have two parameters (task parameter and creator). However the TCP/IP task require no parameter so it is called 'dummy' in its definition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Apr 2013 07:28:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Why-the-TCPIP-task-has-two-argrument/m-p/286804#M9085</guid>
      <dc:creator>karelm_</dc:creator>
      <dc:date>2013-04-30T07:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why the TCPIP_task has two argrument?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Why-the-TCPIP-task-has-two-argrument/m-p/286805#M9086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot, Karel. &lt;/P&gt;&lt;P&gt;After going through the code, I wanna try to summurize this:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;&amp;nbsp; RTCS_task_create created the task RTCS_task, and take a local variable "&amp;amp;task" as parameter, then wait the task.sem be posted.&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; struct rtcs_task_state&amp;nbsp; task;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; RTCS_sem_init(&amp;amp;task.sem);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; task.start = start;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; task.arg&amp;nbsp;&amp;nbsp; = arg;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; task.error = RTCS_OK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; task_template.TASK_ADDRESS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = RTCS_task;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; task_template.CREATION_PARAMETER = (uint_32)&amp;amp;task;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if (_task_create(0, 0, (uint_32)&amp;amp;task_template) == MQX_NULL_TASK_ID) {&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp; } /* Endif */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; RTCS_sem_wait(&amp;amp;task.sem);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; RTCS_sem_destroy(&amp;amp;task.sem);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; return task.error;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;} /* Endbody */&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. RTCS_task run and call task-&amp;gt;start(task-&amp;gt;arg, task), ie, TCPIP_task(task-&amp;gt;arg, task). The "task" here point to "struct rtcs_task_state&amp;nbsp; task" within&amp;nbsp; RTCS_task_create's stack.&lt;/P&gt;&lt;P&gt;3. TCPIP_task runs and post task.sem and continue running&lt;/P&gt;&lt;P&gt;4. RTCS_task_create return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the "creator"&amp;nbsp; just a local variable of the creator.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2013 02:52:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Why-the-TCPIP-task-has-two-argrument/m-p/286805#M9086</guid>
      <dc:creator>JerryFan</dc:creator>
      <dc:date>2013-05-15T02:52:14Z</dc:date>
    </item>
  </channel>
</rss>

