<?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>Mesh serial rx</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26601/mesh-serial-rx</link><description>Hello, 
 I have just started working with mesh and I&amp;#39;m using the 0.9.2 Mesh SDK. When I use the Serial interface (nrf_mesh_serial) I don&amp;#39;t see any function about rx or rx callback. Is it true that Mesh doesn&amp;#39;t support rx interface or I have to write</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 May 2019 13:16:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26601/mesh-serial-rx" /><item><title>RE: Mesh serial rx</title><link>https://devzone.nordicsemi.com/thread/186992?ContentTypeID=1</link><pubDate>Tue, 14 May 2019 13:16:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2483b0a-6e91-41df-8789-cca21432bc5e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Deepa, the link is updated.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mesh serial rx</title><link>https://devzone.nordicsemi.com/thread/186924?ContentTypeID=1</link><pubDate>Tue, 14 May 2019 10:58:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3db7906-b586-40f3-825f-04b8d9ca8987</guid><dc:creator>dk_07</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;Could you please update the link?&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mesh serial rx</title><link>https://devzone.nordicsemi.com/thread/179041?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 16:52:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b353fee4-78a9-4dcf-b8cd-2ad4e81884d6</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please create new case for you issue. Make sure you use&amp;nbsp;a proper COM terminal to receive UART message.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mesh serial rx</title><link>https://devzone.nordicsemi.com/thread/178562?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2019 07:30:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ec37dfc-ca2b-4b2b-8c52-1b9d8589b18c</guid><dc:creator>ycp</dc:creator><description>&lt;p&gt;hi,i am working on nrf52832 mesh3.1.0, i am test the mesh serial example now, why my board can received massage from PC,but PC can not recived massage&amp;nbsp; from board ,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_mesh_serial_tx(hello, sizeof(hello));&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;br /&gt;&lt;strong&gt;This function returns no error,but the PC terminal receied nothing, but use python script can recived &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;as below , can the board just send massage to TX pin ,not use python script?&lt;br /&gt;can you help me?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/900x800/__key/communityserver-discussions-components-files/4/pastedimage1553671723678v1.png" /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mesh serial rx</title><link>https://devzone.nordicsemi.com/thread/104634?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2017 03:46:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:892f8946-d112-4e75-a3df-57f0ab7eac01</guid><dc:creator>Duy</dc:creator><description>&lt;p&gt;Thank you Hung, I send the wrong format so it didn&amp;#39;t work. Now it works well. Now I will try to send a serial string from 1 board to another board using mesh, guess it won&amp;#39;t be difficult.
Thank you for your support :D
Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mesh serial rx</title><link>https://devzone.nordicsemi.com/thread/104633?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2017 16:30:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f923e84-98dc-4ecd-ae73-d1e35935e8cf</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;This is my main loop:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void nrf_mesh_rx_cb(const uint8_t p_data, uint32_t length) { 
	__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Rx received\r\n&amp;quot;); 
}
int main(void)
{
#if defined(NRF51) &amp;amp;&amp;amp; defined(NRF_MESH_STACK_DEPTH)
    stack_depth_paint_stack();
#endif


    __LOG_INIT(LOG_MSK_DEFAULT | LOG_SRC_ACCESS | LOG_SRC_SERIAL | LOG_SRC_APP, LOG_LEVEL_INFO, log_callback_rtt);
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;----- Bluetooth Mesh Serial Interface Application -----\n&amp;quot;);

    NRF_GPIO-&amp;gt;DIRSET = 0xFFFFFFFF;
    NRF_GPIO-&amp;gt;OUT    = LEDS_MASK;

    /* Flash leds at boot */
    for (int i = 0; i &amp;lt; 10; ++i)
    {
        NRF_GPIO-&amp;gt;OUT ^= BSP_LED_0_MASK;
        nrf_delay_ms(100);
    }

    mesh_core_setup();

    /* Initialize dsm and access */
    dsm_init();
    access_init();

    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Enabling ECDH offloading...\n&amp;quot;);
    nrf_mesh_opt_t value = {.len = 4, .opt.val = 1 };
    ERROR_CHECK(nrf_mesh_opt_set(NRF_MESH_OPT_PROV_ECDH_OFFLOADING, &amp;amp;value));

    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Enabling serial interface...\n&amp;quot;);
    ERROR_CHECK(nrf_mesh_serial_init(nrf_mesh_rx_cb));
    ERROR_CHECK(nrf_mesh_serial_enable());

    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Initialization complete!\n&amp;quot;);
    NRF_GPIO-&amp;gt;OUTCLR = BSP_LED_0_MASK;
    uint32_t result;
    char hello[] = &amp;quot;\r\nHello from Nordic\r\n&amp;quot;;
    result = nrf_mesh_serial_tx(hello, sizeof(hello));
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Send result hello: %d\r\n&amp;quot;, result);
    while (true)
    {
        (void)nrf_mesh_process();
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It worked fine. I can see the Hello text on UART (115200 bps)
If I send a application command (opcode start from 0x20) : 0x01 0x20 , I can see RX call back is triggered and text is printed out on RTT.&lt;/p&gt;
&lt;p&gt;Note that you need to use the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v0.10.0/md_doc_libraries_serial.html?cp=4_1_0_5_1"&gt;format of the packet&lt;/a&gt; we have, first byte is length, next is opcode and then payload. The opcode have to be inside the application opcode range I mentioned above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mesh serial rx</title><link>https://devzone.nordicsemi.com/thread/104632?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2017 11:29:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a732fc8-a17c-49f0-a246-d3ec81cdef50</guid><dc:creator>Duy</dc:creator><description>&lt;p&gt;I declared a callback in nrf_mesh_serial_init() but It seems that the callback function doesn&amp;#39;t execute when there is a serial event. This is part of my code, I am modifying the example for sure. I attached the run result in this command too.
&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/run_5F00_result.txt"&gt;run_result.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;All the function returned NRF_SUCCESS (0) but the callback function doesn&amp;#39;t execute. Did I make any mistake? Once again, thank you very much for your support&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mesh serial rx</title><link>https://devzone.nordicsemi.com/thread/104631?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2017 08:43:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a03f31ef-d6ad-4067-bae4-f545f99057c5</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure I understand what you modified in serial_uart.h. Normally it&amp;#39;s not needed. You just need to declare your callback in nrf_mesh_serial_init().&lt;/p&gt;
&lt;p&gt;When you call nrf_mesh_serial_tx() have you checked you have NRF_SUCCESS returned ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mesh serial rx</title><link>https://devzone.nordicsemi.com/thread/104630?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2017 16:48:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fbfe1ef-32ec-4b22-aeb3-2893a6493539</guid><dc:creator>Duy</dc:creator><description>&lt;p&gt;Thank you very much Hung, I finally did it. I just need to point the callback pointer in serial_uart.h to a callback function.
There is still one thing I&amp;#39;m trying to understand is that when I use a tx callback in serial_uart the function nrf_mesh_serial_tx() doesn&amp;#39;t send anything to the serial monitor of PC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mesh serial rx</title><link>https://devzone.nordicsemi.com/thread/104629?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2017 13:58:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0594c24-d184-44a3-bccd-3b5fc6873e7c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Duy,&lt;/p&gt;
&lt;p&gt;The mesh serial interface does support rx. If not how would it take the commands from peer device (PC) :) ?&lt;/p&gt;
&lt;p&gt;UART data is processed in serial_uart.c in serial_uart_process() function.&lt;/p&gt;
&lt;p&gt;The documentation of serial interface can be found &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v3.1.0/md_doc_libraries_serial.html?cp=5_1_2_3_0"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you want to handle extra application command, when you declare nrf_mesh_serial_init() you can define the call back function that you will handle application command there. The opcode for application command should be in the range of SERIAL_OPCODE_CMD_RANGE_APP_START and SERIAL_OPCODE_CMD_RANGE_APP_END.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>