<?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>Client side (on the light switch example) to receive broadcast messages</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32659/client-side-on-the-light-switch-example-to-receive-broadcast-messages</link><description>I am estudying and modifying the light switch example. 
 the example shared in the SDK, this example works as star network. (1 client and 3 (or many) servers) where: 
 - The client sends (unicast and broadcast) messages to servers 
 - The server only</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Apr 2018 08:43:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32659/client-side-on-the-light-switch-example-to-receive-broadcast-messages" /><item><title>RE: Client side (on the light switch example) to receive broadcast messages</title><link>https://devzone.nordicsemi.com/thread/128914?ContentTypeID=1</link><pubDate>Thu, 19 Apr 2018 08:43:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16958c3f-5e56-4a27-a4e4-f241ad58c97c</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;As you probably already know, the&amp;nbsp;simple_on_off_client_set_unreliable() function inside the simple_on_off_client.c file in the light switch client example (mesh sdk 1.0.1) sends the broadcast messages from the client to the server. I believe you could add this function to the server (which you might have already done) &amp;amp; before you call the&amp;nbsp;access_model_publish() function, you can call this function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void address_set(uint16_t addr)
{
    ERROR_CHECK(dsm_address_publish_add(addr, &amp;amp;m_central_handle));
    ERROR_CHECK(access_model_publish_address_set(m_server.model_handle, m_central_handle));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;where, addr is the&amp;nbsp;GROUP_ADDRESS (0xCAFE), m_central_handle is defined as:&lt;/p&gt;
&lt;p&gt;static dsm_handle_t m_central_handle;&lt;/p&gt;
&lt;p&gt;&amp;amp; m_server is already defined in main.c of the light_switch_server example. This should hopefully set the group address in the server &amp;amp; allow you to broadcast a message from the server to the client.&lt;/p&gt;
&lt;p&gt;I am not fully certain this will work, but it is a starting point.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client side (on the light switch example) to receive broadcast messages</title><link>https://devzone.nordicsemi.com/thread/127985?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 08:51:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:633e9164-45c3-4843-95e6-c7ba2a9dd76e</guid><dc:creator>Renato Silva</dc:creator><description>&lt;p&gt;Hi Bjorn,&lt;/p&gt;
&lt;p&gt;This post didnt help me because, I already did the communication between client and server by unicast messages.&lt;/p&gt;
&lt;p&gt;What I wanna do now is subscribe tha client to receive broadcast messages since in tlight switch example only server side receive the broadcast messages, the client side dont..&lt;/p&gt;
&lt;p&gt;How I told above, I already&amp;nbsp; send broadcast messages from server to server (trought 0xCAFE address), but the client dont receive these messages because it is not subscribed.&lt;/p&gt;
&lt;p&gt;I need to modify the light switch example to init the client side able to receive broadcast messages.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div id="selenium-highlight"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client side (on the light switch example) to receive broadcast messages</title><link>https://devzone.nordicsemi.com/thread/127766?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 08:50:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77812275-6ed5-4f19-a293-875dee4676d0</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;I think it might be of interest to take a look at &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/29836/send-and-receive-a-string-via-access-layer" target="_blank" rel="noopener noreferrer"&gt;this devzone post&lt;/a&gt;. It seems some people have had a few difficulties, but most people have gotten it working after debugging a bit.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client side (on the light switch example) to receive broadcast messages</title><link>https://devzone.nordicsemi.com/thread/127390?ContentTypeID=1</link><pubDate>Mon, 09 Apr 2018 10:21:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c2cbd9e-f08d-4a39-b094-745a0534dad3</guid><dc:creator>Renato Silva</dc:creator><description>&lt;p&gt;The question is:&lt;/p&gt;
&lt;p&gt;Why the servers receives the broadcast messages and the client not?&lt;/p&gt;
&lt;p&gt;what function do I need to modify to the client receives the broadcast messages?&lt;/p&gt;
&lt;div id="selenium-highlight"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client side (on the light switch example) to receive broadcast messages</title><link>https://devzone.nordicsemi.com/thread/127235?ContentTypeID=1</link><pubDate>Fri, 06 Apr 2018 13:53:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61548d23-0097-45f5-95e2-f006edd69423</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;The non virtual addresses list is located in device_state_manager.c:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/** Non-virtual addresses */
static regular_address_t m_addresses[DSM_NONVIRTUAL_ADDR_MAX];&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You might be able to use this function here:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void nonvirtual_address_set(uint16_t raw_address, dsm_handle_t handle)
{
    m_addresses[handle].address = raw_address;
    m_addresses[handle].subscription_count = 0;
    m_addresses[handle].publish_count = 0;
    bitfield_set(m_addr_nonvirtual_allocated, handle);
    bitfield_set(m_addr_nonvirtual_needs_flashing, handle);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Seems like this function is used inside the add_address function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static uint32_t add_address(uint16_t raw_address, dsm_handle_t * p_address_handle, dsm_address_role_t role)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client side (on the light switch example) to receive broadcast messages</title><link>https://devzone.nordicsemi.com/thread/126814?ContentTypeID=1</link><pubDate>Wed, 04 Apr 2018 10:58:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9a3fb01-1f3a-4a2b-a1c9-b44f33ef7603</guid><dc:creator>Renato Silva</dc:creator><description>&lt;p&gt;Hi Bjorn,&lt;/p&gt;
&lt;p&gt;I think that I am not clear in my doubt.&lt;/p&gt;
&lt;p&gt;As I said in my last comment, i&lt;span&gt;n the server side I am sending a message using the broadcast address 0xCAFE, and in this format all server received the messages. &lt;/span&gt;&lt;span&gt;This feature works fine!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This way, the client side also received the messages, but for some reason this message is not trated.&lt;/span&gt;&lt;/p&gt;
[quote userid="25682" url="~/f/nordic-q-a/32659/client-side-on-the-light-switch-example-to-receive-broadcast-messages/126800"]Regarding the function,&amp;nbsp;address_nonvirtual_subscription_exists(), this means that the&amp;nbsp;nonvirtual address does not exist in the rx address list of the client, whereas it does in the server.[/quote]
&lt;p&gt;&lt;span&gt;It is exactly this my question! I know that&amp;nbsp;&lt;/span&gt;&lt;span&gt;address_nonvirtual_subscription_exists has a list that has the devices able to receive the message.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My doubt is: How I can to insert the client in this list, for the client device to trate the broadcast message sends from any server.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div id="selenium-highlight"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client side (on the light switch example) to receive broadcast messages</title><link>https://devzone.nordicsemi.com/thread/126800?ContentTypeID=1</link><pubDate>Wed, 04 Apr 2018 10:34:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73999d12-74ef-4198-9798-147e5a42709b</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;You should be able to send a broadcast message from the server side &amp;amp; receive it in the application layer of the client. Regarding the function,&amp;nbsp;address_nonvirtual_subscription_exists(), this means that the&amp;nbsp;nonvirtual address does not exist in the rx address list of the client, whereas it does in the server.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client side (on the light switch example) to receive broadcast messages</title><link>https://devzone.nordicsemi.com/thread/125967?ContentTypeID=1</link><pubDate>Mon, 26 Mar 2018 13:32:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d042cbad-2c99-49c5-8c58-1b1b8ff4a64c</guid><dc:creator>Renato Silva</dc:creator><description>&lt;p&gt;Hi Bjorn&lt;/p&gt;
[quote userid="25682" url="~/f/nordic-q-a/32659/client-side-on-the-light-switch-example-to-receive-broadcast-messages/125946"]Have you updated the server to send &amp;amp; receive broadcast messages?[/quote]
&lt;p&gt;In the original example (light Switch) the servers already received messages from client, but the server only answer to client. The communication server to server I did it!&lt;/p&gt;
[quote userid="25682" url="~/f/nordic-q-a/32659/client-side-on-the-light-switch-example-to-receive-broadcast-messages/125946"] If so, can you not just make the same modifications to the client example as you did to the server side to receive the broadcast messages?[/quote]
&lt;p&gt;In the server side I am sending a message with broadcast address 0xCAFE, and in this format all server received the messages. This way, the client side also received the messages, but for some reason this message is not trated&lt;/p&gt;
&lt;p&gt;The problem is that the solution has a list with all the servers provisioned and when I send a broadcast message all servers received (client&amp;nbsp;doesn&amp;#39;t receive, because it is not present in this list). I am not sure if this is the real problem.&lt;/p&gt;
&lt;p&gt;My doubt is:&amp;nbsp;How can I send a broadcast message from server side and receive it in the application layer (simple_on_off_client.c)?&lt;/p&gt;
&lt;p&gt;In the device_state_manager.c&amp;nbsp; there are the follow function that is used when we sent a broadcast messages.&lt;/p&gt;
&lt;p&gt;static bool rx_group_address_get(uint16_t address, nrf_mesh_address_t * p_address)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;dsm_handle_t handle;&lt;br /&gt;&amp;nbsp;if (address_nonvirtual_subscription_exists(address, &amp;amp;handle))&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;p_address-&amp;gt;value = address;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;p_address-&amp;gt;type = NRF_MESH_ADDRESS_TYPE_GROUP;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;p_address-&amp;gt;p_virtual_uuid = NULL;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;return true;&lt;br /&gt; }&lt;br /&gt;&amp;nbsp; else&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; return false;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Why in the server side the&amp;nbsp;address_nonvirtual_subscription_exists(address, &amp;amp;handle) function retuns true and in the client side the same function returns false?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div id="selenium-highlight"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client side (on the light switch example) to receive broadcast messages</title><link>https://devzone.nordicsemi.com/thread/125946?ContentTypeID=1</link><pubDate>Mon, 26 Mar 2018 12:18:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7723db8a-11c4-47fb-b509-e3719614ef12</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;First off, Bluetooth mesh is not a start network. It is a mesh network with many to many communication capabilities.&lt;/p&gt;
&lt;p&gt;Have you updated the server to send &amp;amp; receive broadcast messages? If so, can you not just make the same modifications to the client example as you did to the server side to receive the broadcast messages?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>