<?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>topic Re: SMAC state diagram in Wireless MCU</title>
    <link>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388385#M333</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AngelC. Thanks for your comments to salah, they are usefull for many of us too. Protocols stack states machine understanding can bring some clarity over the callbacks mechanism so we can add our own functionalities with easy, but for the sake of portability amongst stack revisions it is a bad idea to mess with them. Totally agree with you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your hints again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Victor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Apr 2015 09:12:51 GMT</pubDate>
    <dc:creator>VictorLorenzo</dc:creator>
    <dc:date>2015-04-10T09:12:51Z</dc:date>
    <item>
      <title>SMAC state diagram</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388380#M328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Can anyone help me to find @SMAC state diagram? I read SMAC documents but there is none. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 17:19:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388380#M328</guid>
      <dc:creator>salah</dc:creator>
      <dc:date>2015-04-08T17:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: SMAC state diagram</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388381#M329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;Dear Salah,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;In SMAC Wireless UART application, you may see in main() function that, after initialization, only some functions are called periodically. The functions would correspond to the specific application’s state machine (Wireless UART in this case), the processing of UART buffers and the change of 802.15.4 channel.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp; for(;;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WUApp_MainStateMachine();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WUApp_ProcessCommRxBuffer();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WUApp_ProcessChangeChannel();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;Inside Wireless UART state machine there are several states possible. I will try to explain them using the &lt;EM&gt;enum&lt;/EM&gt; defining the different states possible. Please just notice that the transitions form one to another may come from either a previous state or internal/external events. Running the demo and checking the source code is the best way to understand this is done.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;typedef enum wuAppState_tag&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp; gWUAppStateStart_c&lt;/SPAN&gt;&lt;SPAN style="color: #632423;"&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // only used as start point, goes directly to Idle state&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp; gWUAppStateIdle_c,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #632423;"&gt; // If menus are active, go to configuration state. Otherwise, go to RX always on&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp; gWUAppStateRxAlwaysOn_c,&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #632423;"&gt;// listen for incoming Over-the-air packets&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp; gWUAppStateSendDataComm_c, &lt;/SPAN&gt;&lt;SPAN style="color: #632423;"&gt;//print received data to UART, set from MCPSDataIndication&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp; gWUAppStateSendDataOta_c, &lt;/SPAN&gt;&lt;SPAN style="color: #632423;"&gt;// Send data over the air, set after typing characters in demo mode&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp; gWUAppStateWaitAckOta_c,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #632423;"&gt;// Wait for ACK after sending a packet. Only if these are enabled.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp; gWUAppStateSendAckOta_c,&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #632423;"&gt;// Send ACK if enabled&lt;/SPAN&gt;&lt;SPAN style="color: #0f243e;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp; gWUAppStateRetryDataOta_c, &lt;/SPAN&gt;&lt;SPAN style="color: #632423;"&gt;// Retry packet transmission (If ACK is enabled and was not received)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;&amp;nbsp; gWUAppStateMax_c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #632423;"&gt;// max value of states&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;}wuAppState_t;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;I hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f243e;"&gt;AngelC&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 21:04:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388381#M329</guid>
      <dc:creator>AngelC</dc:creator>
      <dc:date>2015-04-08T21:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: SMAC state diagram</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388382#M330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Angelc! I liked your answer. I will explain what I was trying to do. Basically, I am trying to understand SMAC in terms of as a MAC protocol. So if I want to implement CSMA technique I need to understand SMAC state diagram so I can implement CSMA by modifying SMAC for sake of experiment. You have mentioned long time ago, I can use CCA and ED to achieve that. I am still struggling to understand how I can accomplish that. If you have an example I can see may help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks! a lot again.&lt;/P&gt;&lt;P&gt;Salah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 17:30:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388382#M330</guid>
      <dc:creator>salah</dc:creator>
      <dc:date>2015-04-09T17:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: SMAC state diagram</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388383#M331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi AngelC,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are the SMAC implementations for KW01 and for MC1319x, MC1320x and MC1321x (targeted for the S08 core) similar?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use the SMAC implementation for the KW01 and, IMO, it does implement kind of a states machine in the protocol stack for controlling the transceiver. In file SMAC.h, look for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;typedef enum smacStates_tag {&lt;/P&gt;&lt;P&gt;&amp;nbsp; mSmacStateIdle_c,&lt;/P&gt;&lt;P&gt;&amp;nbsp; mSmacStateTransmitting_c,&lt;/P&gt;&lt;P&gt;&amp;nbsp; mSmacStateReceiving_c,&lt;/P&gt;&lt;P&gt;&amp;nbsp; mSmacStateScanningChannels_c,&lt;/P&gt;&lt;P&gt;&amp;nbsp; mSmacStatePerformingTest_c,&lt;/P&gt;&lt;P&gt;&amp;nbsp; mSmacStateHibernate_c,&lt;/P&gt;&lt;P&gt;&amp;nbsp; mSmacStateDoze_c&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;} smacStates_t;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In file SMAC.c it is instantiated in a local (static) variable and used in several functions throughout the code. The states machine is not implemented in the traditional way with a centralized events processing function and all of that fancy flavour we tend to like so much in the academic world, it is implemented more like an asynchronous and rudimentary events processing strategy for avoiding collitions in transceiver usage. But it resembles a states machine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;From my point of view, States machine and RTOS are two independen concepts so perhaps your point "&lt;SPAN style="color: #0f243e; text-decoration: line-through;"&gt;&lt;EM&gt;SMAC does not use any sort of RTOS and therefore it does not has a state machine at stack level at all&lt;/EM&gt;&lt;/SPAN&gt;" could somehow be inaccurate&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards, Victor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 19:13:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388383#M331</guid>
      <dc:creator>VictorLorenzo</dc:creator>
      <dc:date>2015-04-09T19:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Re: SMAC state diagram</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388384#M332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif; color: #003366;"&gt;Thanks for the heads up Victor. You are right; I edited the comment not to cause any misunderstanding regarding SMAC stack at all. There is a state machine for radio management at stack level indeed.&amp;nbsp; However, since Salah is looking to implement the CCA/ED functionality, then I consider that messing up with SMAC state machine would not be the best way to go.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif; color: #003366;"&gt;In this particular case, it would be better to keep such state machine unchanged (not modifying SMAC.c or SMAC.h) and use SMAC API’s at application level to perform a CCA/ED scan and then transmit or do whatever intended by the final application. These commands would be called at application state machine either by adding additional states or calling functions inline in the actual ones.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif; color: #003366;"&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/salah"&gt;salah&lt;/A&gt;, to implement the ED you could use the MLMEEnergyDetect() function and then, based in the results, decide whether to transmit in such channel or not.&amp;nbsp; This is only one approach; you may implement it in any different way you would like to. For further details about the available API’s please refer to SMAC for MKW2x Reference manual included in Beekit’s Documentation folder&lt;SPAN class="SC773740"&gt;. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="SC773740" style="font-size: 10pt; font-family: arial,helvetica,sans-serif; color: #003366;"&gt;Please also notice the MAC (802.15.4) already performs the CSMA-CA automatically. You may also consider using such software stack instead.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif; color: #003366;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366; font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;AngelC&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 21:37:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388384#M332</guid>
      <dc:creator>AngelC</dc:creator>
      <dc:date>2015-04-09T21:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: SMAC state diagram</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388385#M333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AngelC. Thanks for your comments to salah, they are usefull for many of us too. Protocols stack states machine understanding can bring some clarity over the callbacks mechanism so we can add our own functionalities with easy, but for the sake of portability amongst stack revisions it is a bad idea to mess with them. Totally agree with you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your hints again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Victor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2015 09:12:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/SMAC-state-diagram/m-p/388385#M333</guid>
      <dc:creator>VictorLorenzo</dc:creator>
      <dc:date>2015-04-10T09:12:51Z</dc:date>
    </item>
  </channel>
</rss>

