<?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>Wireless MCUのトピックImplementing vSaveScenesNVM() saving scences to PDM for a multi endpoint device</title>
    <link>https://community.nxp.com/t5/Wireless-MCU/Implementing-vSaveScenesNVM-saving-scences-to-PDM-for-a-multi/m-p/1594756#M14470</link>
    <description>&lt;P&gt;I am working with&amp;nbsp;&lt;STRONG&gt;JN5189.&amp;nbsp;&lt;/STRONG&gt;Using the JN-AN-1247 as my base device. I have added 3 more endpoints with LightOn/Off devices on it. I might also add temp and humidity sensor related clusters on it as well in near future.&lt;BR /&gt;&lt;BR /&gt;In order to implement scenes on it I have followed JN-AN-1244 for the file of &lt;STRONG&gt;app_scene .c/.h.&amp;nbsp;&lt;/STRONG&gt; I am a bit confused here as all over I am seeing implementation of this for one endpoint. What I need is to implemnet it for multiple endpoints&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to Implemnet the code below to handle the saving of the scene to the PDM for all endponints and all devices. For example I have 5 endpoints , 1 having a controlBridge device and an on_off_light and 3 other on_off_lighst on endpoint 2,3 and 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/****************************************************************************
*
* NAME: vSaveScenesNVM
*
* DESCRIPTION:
* To save scenes data to EEPROM
*
* RETURNS:
* void
*
****************************************************************************/
PUBLIC void vSaveScenesNVM(void)
{
    uint8 i=0, j=0;
    tsCLD_ScenesTableEntry *psTableEntry;

    /* Before saving data again clear off the earlier entries and recopy all the scenes */
    memset(&amp;amp;sScenesCustomData,0,sizeof(tsAPP_ScenesCustomData));
    
    psTableEntry = (tsCLD_ScenesTableEntry*)psDLISTgetHead(&amp;amp;sOnOFFLight1.sScenesServerCustomDataStructure.lScenesAllocList);
    
    for(i = 0; i &amp;lt; iDLISTnumberOfNodes(&amp;amp;sOnOFFLight1.sScenesServerCustomDataStructure.lScenesAllocList); i++)
    {
        if(psTableEntry != NULL)
        {
             sScenesCustomData.asScenesCustomTableEntry[j].bIsSceneValid = TRUE;
              sScenesCustomData.asScenesCustomTableEntry[j].u16GroupId = psTableEntry-&amp;gt;u16GroupId;
              sScenesCustomData.asScenesCustomTableEntry[j].u8SceneId = psTableEntry-&amp;gt;u8SceneId;
             sScenesCustomData.asScenesCustomTableEntry[j].u16TransitionTime = psTableEntry-&amp;gt;u16TransitionTime;
             sScenesCustomData.asScenesCustomTableEntry[j].u16SceneDataLength = psTableEntry-&amp;gt;u16SceneDataLength;
             memcpy(sScenesCustomData.asScenesCustomTableEntry[j].au8SceneData,psTableEntry-&amp;gt;au8SceneData,psTableEntry-&amp;gt;u16SceneDataLength);
              #ifdef CLD_SCENES_TABLE_SUPPORT_TRANSITION_TIME_IN_MS
                     sScenesCustomData.asScenesCustomTableEntry[j].u8TransitionTime100ms = psTableEntry-&amp;gt;u8TransitionTime100ms;
              #endif
              j++;
        }
        psTableEntry = (tsCLD_ScenesTableEntry*)psDLISTgetNext((DNODE*)psTableEntry);
    }

    PDM_eSaveRecordData(PDM_ID_APP_SCENES_DATA,&amp;amp;sScenesCustomData,sizeof(tsAPP_ScenesCustomData));
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Feb 2023 13:04:35 GMT</pubDate>
    <dc:creator>dmsherazi</dc:creator>
    <dc:date>2023-02-07T13:04:35Z</dc:date>
    <item>
      <title>Implementing vSaveScenesNVM() saving scences to PDM for a multi endpoint device</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Implementing-vSaveScenesNVM-saving-scences-to-PDM-for-a-multi/m-p/1594756#M14470</link>
      <description>&lt;P&gt;I am working with&amp;nbsp;&lt;STRONG&gt;JN5189.&amp;nbsp;&lt;/STRONG&gt;Using the JN-AN-1247 as my base device. I have added 3 more endpoints with LightOn/Off devices on it. I might also add temp and humidity sensor related clusters on it as well in near future.&lt;BR /&gt;&lt;BR /&gt;In order to implement scenes on it I have followed JN-AN-1244 for the file of &lt;STRONG&gt;app_scene .c/.h.&amp;nbsp;&lt;/STRONG&gt; I am a bit confused here as all over I am seeing implementation of this for one endpoint. What I need is to implemnet it for multiple endpoints&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to Implemnet the code below to handle the saving of the scene to the PDM for all endponints and all devices. For example I have 5 endpoints , 1 having a controlBridge device and an on_off_light and 3 other on_off_lighst on endpoint 2,3 and 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/****************************************************************************
*
* NAME: vSaveScenesNVM
*
* DESCRIPTION:
* To save scenes data to EEPROM
*
* RETURNS:
* void
*
****************************************************************************/
PUBLIC void vSaveScenesNVM(void)
{
    uint8 i=0, j=0;
    tsCLD_ScenesTableEntry *psTableEntry;

    /* Before saving data again clear off the earlier entries and recopy all the scenes */
    memset(&amp;amp;sScenesCustomData,0,sizeof(tsAPP_ScenesCustomData));
    
    psTableEntry = (tsCLD_ScenesTableEntry*)psDLISTgetHead(&amp;amp;sOnOFFLight1.sScenesServerCustomDataStructure.lScenesAllocList);
    
    for(i = 0; i &amp;lt; iDLISTnumberOfNodes(&amp;amp;sOnOFFLight1.sScenesServerCustomDataStructure.lScenesAllocList); i++)
    {
        if(psTableEntry != NULL)
        {
             sScenesCustomData.asScenesCustomTableEntry[j].bIsSceneValid = TRUE;
              sScenesCustomData.asScenesCustomTableEntry[j].u16GroupId = psTableEntry-&amp;gt;u16GroupId;
              sScenesCustomData.asScenesCustomTableEntry[j].u8SceneId = psTableEntry-&amp;gt;u8SceneId;
             sScenesCustomData.asScenesCustomTableEntry[j].u16TransitionTime = psTableEntry-&amp;gt;u16TransitionTime;
             sScenesCustomData.asScenesCustomTableEntry[j].u16SceneDataLength = psTableEntry-&amp;gt;u16SceneDataLength;
             memcpy(sScenesCustomData.asScenesCustomTableEntry[j].au8SceneData,psTableEntry-&amp;gt;au8SceneData,psTableEntry-&amp;gt;u16SceneDataLength);
              #ifdef CLD_SCENES_TABLE_SUPPORT_TRANSITION_TIME_IN_MS
                     sScenesCustomData.asScenesCustomTableEntry[j].u8TransitionTime100ms = psTableEntry-&amp;gt;u8TransitionTime100ms;
              #endif
              j++;
        }
        psTableEntry = (tsCLD_ScenesTableEntry*)psDLISTgetNext((DNODE*)psTableEntry);
    }

    PDM_eSaveRecordData(PDM_ID_APP_SCENES_DATA,&amp;amp;sScenesCustomData,sizeof(tsAPP_ScenesCustomData));
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 13:04:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Implementing-vSaveScenesNVM-saving-scences-to-PDM-for-a-multi/m-p/1594756#M14470</guid>
      <dc:creator>dmsherazi</dc:creator>
      <dc:date>2023-02-07T13:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing vSaveScenesNVM() saving scences to PDM for a multi endpoint device</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Implementing-vSaveScenesNVM-saving-scences-to-PDM-for-a-multi/m-p/1598412#M14512</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/60917"&gt;@dmsherazi&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Function vSaveScenesNVM() should extract the scenes from the endpoint structure and copy them into NVM; you should be able to do a custom implementation to provide this function a device/endpoint at a time. For more information, please consult JN-UG-3133-Core-Utilities, Chapter 6 PDM API.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Eduardo.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 21:51:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Implementing-vSaveScenesNVM-saving-scences-to-PDM-for-a-multi/m-p/1598412#M14512</guid>
      <dc:creator>EduardoZamora</dc:creator>
      <dc:date>2023-02-13T21:51:16Z</dc:date>
    </item>
  </channel>
</rss>

