<?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: _lwmsgq_receive check for message</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwmsgq-receive-check-for-message/m-p/189099#M3561</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help. I am still learning where to find documentation on the MQX functions. It appears there a lot of information in the header files that is not included in the MQX manual.&amp;nbsp; I never did find&amp;nbsp;LWMSGQ_IS_EMPTY in the MQX&amp;nbsp;documentation. Is this typical for all the MQX functions or specific to the the light weight message functions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again thanks&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Mar 2011 03:44:58 GMT</pubDate>
    <dc:creator>barbercolman</dc:creator>
    <dc:date>2011-03-09T03:44:58Z</dc:date>
    <item>
      <title>_lwmsgq_receive check for message</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwmsgq-receive-check-for-message/m-p/189097#M3559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to using MQX and its documentation. The _lwmsgq_receive function in the reference manual, has a LWMSGQ_RECEIVE_BLOCK_ON_EMPTY with an error code of LWMSGQ_EMPTY. However, a block task never returns. How do I check to see if there is an message?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been looking at the MQX reference guide, the users guide and the guide. Like I said I am new at this but where is the documentation? I am thinking there should be a documented way to find the number of messages or the status and I have not found it YET. Hope springs eternal!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2011 22:52:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwmsgq-receive-check-for-message/m-p/189097#M3559</guid>
      <dc:creator>barbercolman</dc:creator>
      <dc:date>2011-03-07T22:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: _lwmsgq_receive check for message</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwmsgq-receive-check-for-message/m-p/189098#M3560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Barber,&lt;/P&gt;&lt;P&gt;I've taken the default FSLMQX/mqx/examples/lwmsgq project and modified it to operate in several ways by changine #if / #elif statements.&lt;/P&gt;&lt;P&gt;1)_lwmsgq_receive((pointer)server_queue, msg, LWMSGQ_TIMEOUT_FOR, 0, 0);&amp;nbsp;&amp;nbsp;&amp;nbsp; //blocks while waiting for message...default code&lt;/P&gt;&lt;P&gt;2)_lwmsgq_receive((pointer)server_queue, msg, LWMSGQ_RECEIVE_BLOCK_ON_EMPTY, 1, &amp;amp;ticks);&amp;nbsp;&amp;nbsp; //blocks only 1 tick duration waiting for message&lt;/P&gt;&lt;P&gt;3) if (!LWMSGQ_IS_EMPTY(server_queue)){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //checks for message in queue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Server.c snippet:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; while (TRUE) {&lt;BR /&gt;#if 1 //DES test code&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!LWMSGQ_IS_EMPTY(server_queue)){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //checks for message in queue&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Queue has message....go get it... ");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _lwmsgq_receive((pointer)server_queue, msg, LWMSGQ_TIMEOUT_FOR, 0, 0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(" %c \n", msg[0]);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _lwmsgq_send((pointer)client_queue, msg, LWMSGQ_SEND_BLOCK_ON_FULL);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("\t\t***NO MESSAGE IN QUEUE***\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_delay_ticks(1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //DES block to give other task(s) chance to run&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;#elif 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //DES test code&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = _lwmsgq_receive((pointer)server_queue, msg, LWMSGQ_RECEIVE_BLOCK_ON_EMPTY, 1, &amp;amp;ticks);&amp;nbsp;&amp;nbsp; //blocks only 1 tick duration waiting for message&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(result == MQX_OK){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(" %c \n", msg[0]);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _lwmsgq_send((pointer)client_queue, msg, LWMSGQ_SEND_BLOCK_ON_FULL);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if(result == LWMSGQ_TIMEOUT){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("LWMSGQ_TIMEOUT\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("error=0x%08X\n", result);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;#else&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //DES default code&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _lwmsgq_receive((pointer)server_queue, msg, LWMSGQ_TIMEOUT_FOR, 0, 0);&amp;nbsp;&amp;nbsp;&amp;nbsp; //blocks while waiting for message&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(" %c \n", msg[0]);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _lwmsgq_send((pointer)client_queue, msg, LWMSGQ_SEND_BLOCK_ON_FULL);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;#endif&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Client.c snippet:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_delay_ticks(5);&lt;BR /&gt;//DES&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_delay_ticks(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried attaching the files but system wasn't letting me do that :smileysad:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 02:41:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwmsgq-receive-check-for-message/m-p/189098#M3560</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2011-03-09T02:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: _lwmsgq_receive check for message</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwmsgq-receive-check-for-message/m-p/189099#M3561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help. I am still learning where to find documentation on the MQX functions. It appears there a lot of information in the header files that is not included in the MQX manual.&amp;nbsp; I never did find&amp;nbsp;LWMSGQ_IS_EMPTY in the MQX&amp;nbsp;documentation. Is this typical for all the MQX functions or specific to the the light weight message functions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again thanks&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 03:44:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwmsgq-receive-check-for-message/m-p/189099#M3561</guid>
      <dc:creator>barbercolman</dc:creator>
      <dc:date>2011-03-09T03:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: _lwmsgq_receive check for message</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwmsgq-receive-check-for-message/m-p/189100#M3562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Barber,&lt;/P&gt;&lt;P&gt;Yes to the question that not every function or macro call is fully documented.&amp;nbsp; The doc's to a good high level of implementation, understanding, and advice for porting but one must roll-up the shirt sleeves and review code to find answers to questions not in the documentation.&lt;/P&gt;&lt;P&gt;I often start by using one of the FSLMQX/mqx/examples projects then look at headers and/or do searches on keywords.&amp;nbsp; That is the path I took for creating the lwmsgq example.&lt;/P&gt;&lt;P&gt;As time passes we/Freescale will keep adding to the documentation to improve.&amp;nbsp; Sorry for any hassles.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 22:42:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwmsgq-receive-check-for-message/m-p/189100#M3562</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2011-03-09T22:42:27Z</dc:date>
    </item>
  </channel>
</rss>

