<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Finite state machine Question</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44455/finite-state-machine-question</link><description>Hi all, 
 I may need some guidance on the finite state machine method which found an example in app_level.c (from nRF5 SDK for Mesh v3.1), please see my question on below:- 
 
 What is event id use for? found the function generic_level_state_set_cb()</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 May 2019 06:18:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44455/finite-state-machine-question" /><item><title>RE: Finite state machine Question</title><link>https://devzone.nordicsemi.com/thread/188081?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 06:18:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4c5ca98-fbb1-449f-b65d-d178c4cd2d26</guid><dc:creator>kokheng</dc:creator><description>&lt;p&gt;Hi Chris_Dev,&lt;/p&gt;
&lt;p&gt;Yes, I may need help on this question. Thanks first :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Finite state machine Question</title><link>https://devzone.nordicsemi.com/thread/188080?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 06:07:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:971b08ef-07f6-4008-82b5-c22aecd0e39b</guid><dc:creator>Chris_Dev</dc:creator><description>&lt;p&gt;Hi Kokheng, did you manage to figure it out? I might be able to help you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Finite state machine Question</title><link>https://devzone.nordicsemi.com/thread/175955?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 13:36:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:614bfa52-8c8c-45ba-8725-319a3fc29a1f</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am sorry. We don&amp;#39;t have any other documentation other than that in the code files (.c and .h files).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;One of my colleagues sent me this photo, which they used when they wrote the code:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-614ad630b6424c21b7437a48a14644c2/dimming_5F00_server.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Finite state machine Question</title><link>https://devzone.nordicsemi.com/thread/175501?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2019 01:51:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f1b2b5a-1ab9-44cb-8123-7ea2baf5b128</guid><dc:creator>kokheng</dc:creator><description>&lt;p&gt;Thanks Edvin,&amp;nbsp;does Nordic provide doc to explain how FSM work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Finite state machine Question</title><link>https://devzone.nordicsemi.com/thread/175302?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2019 11:51:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:858ec675-7779-43ae-81d2-da803625be48</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I suggest that you try to set #define&amp;nbsp;FSM_DEBUG (1) in nrf_mesh_config_core.h on line 519. It will then post some finite state machine debug information in the log.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It seems a bit complicated. It looks like it depends on what state it was in before calling fsm_event_post(). My best tip for you is to try it out with the FSM_DEBUG = 1 and see what happens.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Finite state machine Question</title><link>https://devzone.nordicsemi.com/thread/175162?ContentTypeID=1</link><pubDate>Sat, 09 Mar 2019 01:47:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:747fd99f-05d6-4a5f-b73d-93ff25e9a93b</guid><dc:creator>kokheng</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I have one assignment that needs to support Generic default transition time server and using&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;nRF52840 - DK board&lt;/li&gt;
&lt;li&gt;nRF5 SDK v15.2 + nRF5 SDK for mesh v3.1&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;From the below examples (i.e. nRF5 SDK for mesh v3.1),&amp;nbsp;I try to copy the same coding style and then build into my Generic default time server example where it will base on a light-switch example&amp;nbsp;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;light-switch - refer to Server folder and using Generic On/OFF Server&lt;/li&gt;
&lt;li&gt;experimental_dimming - refer to the server folder and using Generic Level Server&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In the end, it will combine both Generic ON/OFF Server and Generic default&amp;nbsp;transition time server into one project.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-----------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;In the&amp;nbsp;&lt;span&gt;nRF5 SDK for mesh source code, it already provides&amp;nbsp; some of the models&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;generic_dtt&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;generic_level&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;generic_onoff&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;generic_ponoff&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;light-switch example using generic_onoff models and build a code layer (i.e. app_onoff.c) between main.c and generic_onoff model.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;experimental_dimming&amp;nbsp;using generic_onoff models and build a code layer (i.e. app_level.c) between main.c and generic_level model.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My example is based on example&amp;nbsp;light-switch - Server,&amp;nbsp; and I try to build the Generic default transition time server on top of it. The same concept as the above examples, my example will have app_dtt.c between of main.c and generic_dff models.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If my understanding not correct, please correct here!!!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My question is generated after reviewing the example&amp;nbsp;experimental_dimming - server folder, where it builds a finite state machine in&amp;nbsp;app_level.c. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In&amp;nbsp;this finite state machine,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;In the State &amp;quot;FSM_ANY_STATE&amp;quot; - The E_SET Event will trigger the FSM by fsm_event_post(&amp;amp;p_server-&amp;gt;fsm, E_SET, p_server) but there is three event as shown in below&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;FSM_TRANSITION(E_SET, G_SET_DELAY, A_DELAY_START, S_IN_DELAY),&lt;br /&gt;FSM_TRANSITION(E_SET, G_SET_TRANSITION, A_TRANSITION_START, S_IN_TRANSITION),&lt;br /&gt;FSM_TRANSITION(E_SET, FSM_OTHERWISE, A_TRANSITION_COMPLETE,S_IDLE)&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;May I know which line will go into first?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and if you found any wrong from my understanding, please correct me.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Finite state machine Question</title><link>https://devzone.nordicsemi.com/thread/175037?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2019 13:50:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbc1abe3-57cd-4409-97d3-68c90f56c0bf</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have not seen this before. I see that it is in the SDK. What example are you referring to, and do you see an issue?&lt;/p&gt;
&lt;p&gt;I believe I don&amp;#39;t understand your question. Can you please elaborate?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>