<?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>I want to combine Switch_light client &amp;amp; provisioner,  i want provisioner to control any node.Here is my steps, is some steps miss or wrong? it does&amp;#39;nt work yet!</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44967/i-want-to-combine-switch_light-client-provisioner-i-want-provisioner-to-control-any-node-here-is-my-steps-is-some-steps-miss-or-wrong-it-does-nt-work-yet</link><description>Step1 : init a Client model in Provisoner: 
 
 Step2 :config this client: 
 
 Step3:set the pub address of this client &amp;amp; control the remote gen_onoff_Server model: but it can not work at this step, the status return 7 , how to slove it ?? 
 
 By the way</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Mar 2019 08:52:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44967/i-want-to-combine-switch_light-client-provisioner-i-want-provisioner-to-control-any-node-here-is-my-steps-is-some-steps-miss-or-wrong-it-does-nt-work-yet" /><item><title>RE: I want to combine Switch_light client &amp; provisioner,  i want provisioner to control any node.Here is my steps, is some steps miss or wrong? it does'nt work yet!</title><link>https://devzone.nordicsemi.com/thread/176626?ContentTypeID=1</link><pubDate>Mon, 18 Mar 2019 08:52:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:127daa9e-34ac-4c45-b9b6-cedff313213a</guid><dc:creator>ycp</dc:creator><description>&lt;p&gt;wa! it finally OK!&amp;nbsp; it works&lt;/p&gt;
&lt;p&gt;step3 SHOULD like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; case 1:
            {
                 set_params.tid = tid++;
                 transition_params.delay_ms = 50;
                 transition_params.transition_time_ms = 100;
                 set_params.on_off = !set_params.on_off;
                 dsm_address_publish_add(GROUP_ADDRESS_ODD,&amp;amp;publish_address_handle);
                 dsm_address_publish_add(GROUP_ADDRESS_EVEN,&amp;amp;publish_address_handle_1);
                 if(recv_sucess == 0)
                 {
                  if(i)
                  {
                  status = access_model_publish_address_set(m_clients[0].model_handle,publish_address_handle);
                  publish_address_handle_both = publish_address_handle;
                  publish_address_handle_true = publish_address_handle;
                  i=0;
                  }
                 else
                 {
                    status = access_model_publish_address_set(m_clients[0].model_handle,publish_address_handle_1);
                    publish_address_handle_both = publish_address_handle_1;
                    publish_address_handle_true = publish_address_handle_1;
                    i=!i;
                  }
            }
            else
            {
                  status = access_model_publish_address_set(m_clients[0].model_handle,publish_address_handle_true);
            }
             
             printf(&amp;quot;publish_address_handle_both:%d \n&amp;quot;,publish_address_handle_both);

            
             (void)access_model_reliable_cancel(m_clients[0].model_handle);
             status = generic_onoff_client_set(&amp;amp;m_clients[0], &amp;amp;set_params, &amp;amp;transition_params);
             printf(&amp;quot;generic onoff send set_params.on_off:%d -- %d \n&amp;quot;,set_params.on_off,status);
             hal_led_pin_set(BSP_LED_1, set_params.on_off);
             break;
            }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to combine Switch_light client &amp; provisioner,  i want provisioner to control any node.Here is my steps, is some steps miss or wrong? it does'nt work yet!</title><link>https://devzone.nordicsemi.com/thread/176601?ContentTypeID=1</link><pubDate>Mon, 18 Mar 2019 06:53:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcb89182-dde8-4ddb-ba4e-e66129423f85</guid><dc:creator>ycp</dc:creator><description>&lt;p&gt;I trace the code ,find some msg here, is that i add a publication address wrong , how to add it ?&lt;pre class="ui-code" data-mode="c_cpp"&gt;static bool check_tx_params(access_model_handle_t handle, const access_message_tx_t * p_tx_message, const access_message_rx_t * p_rx_message, uint32_t * p_status)
{
    NRF_MESH_ASSERT(NULL != p_status);

    /* Various checks being done here to ensure that model does not publish a message if
       publication is disabled by setting - Unassigned publish address, or deleted app key */
    if (p_tx_message-&amp;gt;length &amp;gt;= ACCESS_MESSAGE_LENGTH_MAX)
    {
        *p_status = NRF_ERROR_INVALID_LENGTH;
    }
    else if (!model_handle_valid_and_allocated(handle) ||
             m_model_pool[handle].model_info.element_index &amp;gt;= ACCESS_ELEMENT_COUNT)
    {
        *p_status = NRF_ERROR_NOT_FOUND;
    }
    else if ((p_rx_message == NULL &amp;amp;&amp;amp;
             (m_model_pool[handle].model_info.publish_appkey_handle  == DSM_HANDLE_INVALID ||
              m_model_pool[handle].model_info.publish_address_handle == DSM_HANDLE_INVALID)) ||
              !is_valid_opcode(p_tx_message-&amp;gt;opcode))
    {
        
        printf(&amp;quot;%s....%d \n&amp;quot;,__FUNCTION__,__LINE__);
        printf(&amp;quot;p_rx_message :%p \n&amp;quot;,p_rx_message);
        printf(&amp;quot;m_model_pool[handle].model_info.publish_address_handle :%d \n&amp;quot;,m_model_pool[handle].model_info.publish_address_handle);
        printf(&amp;quot;m_model_pool[handle].model_info.publish_appkey_handle:%d \n&amp;quot;,m_model_pool[handle].model_info.publish_appkey_handle);
        printf(&amp;quot;is_valid_opcode(p_tx_message-&amp;gt;opcode):%d \n&amp;quot;,is_valid_opcode(p_tx_message-&amp;gt;opcode));
        *p_status = NRF_ERROR_INVALID_PARAM;
    }
    else
    {
        *p_status = NRF_SUCCESS;
    }

    return (NRF_SUCCESS == *p_status);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;p_rx_message :00000000 &lt;br /&gt;m_model_pool[handle].model_info.publish_address_handle :65535 &lt;br /&gt;m_model_pool[handle].model_info.publish_appkey_handle:0 &lt;br /&gt;is_valid_opcode(p_tx_message-&amp;gt;opcode):1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>