<?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>HOW TO READ FROM MULTIPLE BLE CHARACTER</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49813/how-to-read-from-multiple-ble-character</link><description>i can create three service each with one notifiable characteristic. i am using nrf connect to test if it is work and i am able to send data through UART Rx and then enabled all the notifiable characteristics of each services. and I am able to read fro</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Jul 2019 08:39:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49813/how-to-read-from-multiple-ble-character" /><item><title>RE: HOW TO READ FROM MULTIPLE BLE CHARACTER</title><link>https://devzone.nordicsemi.com/thread/199152?ContentTypeID=1</link><pubDate>Thu, 18 Jul 2019 08:39:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e047c475-881e-4db6-be27-03f22c52f37d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I don&amp;#39;t think &amp;quot;&lt;span&gt;&lt;em&gt;D/BluetoothLeScanner: could not find callback wrapper&lt;/em&gt;&amp;nbsp;&amp;quot; has anything to do with reading the characteristic. You can read more about it &lt;a href="https://stackoverflow.com/questions/40862767/bluetoothlescanner-could-not-find-callback-wrapper"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Did you do Service Discovery on your Android app and found all 3 services ? Could you show the code on how you read the characteristic ? What value do you expected to see ? Because in NUS service we don&amp;#39;t usually read, we do write and notification.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HOW TO READ FROM MULTIPLE BLE CHARACTER</title><link>https://devzone.nordicsemi.com/thread/199044?ContentTypeID=1</link><pubDate>Wed, 17 Jul 2019 15:01:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eef534bb-5935-4850-b17b-f5e4278e560d</guid><dc:creator>Nahom</dc:creator><description>&lt;p&gt;I already create my service and my characteristics. Even i checked all the services and characteristics using nRFConnect if they work good. They work perfect. On my android phone i am able to discover all the characteristics and services but i am not able to read the values. as you can seen on my android console all the connection setup ed correctly but&amp;nbsp; when it tries to read the values it gives this warning.&lt;/p&gt;
&lt;p&gt;D/BluetoothLeScanner: could not find callback wrapper&lt;/p&gt;
&lt;p&gt;if you see my ble_app_uart code i am using one nus_data_handler for all the services&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void nus_data_handler(ble_nus_evt_t * p_evt)
{
    if ((p_evt-&amp;gt;type == BLE_NUS_EVT_RX_DATA) &amp;amp;&amp;amp; (isConnected))
    {
      
       first_ser = true;
      Recieved_command_Start = true;
      if(p_evt-&amp;gt;params.rx_data.length &amp;gt; 2)
      {
       
        NRF_LOG_INFO(&amp;quot; first character should st&amp;quot;);
        
       third_ser =false;
       second_ser = false;
        Report_command_send = false;
        Version_command_send = false;
      }
        uint32_t err_code;
        memset (lastCommand, 0, 256);
        strncpy (lastCommand, (char *) p_evt-&amp;gt;params.rx_data.p_data, p_evt-&amp;gt;params.rx_data.length);
//        printf(&amp;quot;%s\r\n&amp;quot;, lastCommand);        
        //NRF_LOG_HEXDUMP_DEBUG(p_evt-&amp;gt;params.rx_data.p_data, p_evt-&amp;gt;params.rx_data.length);
        for (uint32_t i = 0; i &amp;lt; p_evt-&amp;gt;params.rx_data.length; i++)
        {
            do
            {
                err_code = app_uart_put(p_evt-&amp;gt;params.rx_data.p_data[i]);
              // NRF_LOG_INFO(&amp;quot;Data ver is set to %c  :(%d)&amp;quot;,lastCommand[i],p_evt-&amp;gt;params.rx_data.length);
                if ((err_code != NRF_SUCCESS) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY))
                {
                    NRF_LOG_ERROR(&amp;quot;Failed receiving NUS message. Error 0x%x. &amp;quot;, err_code);
                    APP_ERROR_CHECK(err_code);
                }
            } while (err_code == NRF_ERROR_BUSY);
        }
        
        while (app_uart_put(&amp;#39;\r&amp;#39;) == NRF_ERROR_BUSY);
        NRF_LOG_INFO(&amp;quot;Command sent %s &amp;quot;, lastCommand);
     
    }

 /*----------------------------------------------------------------------------------------------------------------*/
  if ( (p_evt-&amp;gt;type == BLE_NUS_EVT_TX_RDY) &amp;amp;&amp;amp; (isConnected) &amp;amp;&amp;amp; (Version_command_send))
  {
     NRF_LOG_INFO(&amp;quot; second character should st&amp;quot;);
    second_ser = true;
    third_ser = false;
    //first_ser = false;
    Report_command_send = false;
    Version_command_send = false;
    size_t length = sizeof(version) / sizeof(version[0]);
    int i;
    uint32_t   err_code;
         memset (lastCommand, 0, 256);
        strncpy (lastCommand, (char *) version,length-1);

        for (i = 0; i &amp;lt; length-1; i++)
        {
            do
            {
                err_code = app_uart_put(version[i]);
               // NRF_LOG_INFO(&amp;quot;Data ver is set to 0x%X(%d)&amp;quot;, version[i],length-1);
                if ((err_code != NRF_SUCCESS) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY))
                {
                    NRF_LOG_ERROR(&amp;quot;Failed receiving NUS message. Error 0x%x. &amp;quot;, err_code);
                    APP_ERROR_CHECK(err_code);
                }
            } while (err_code == NRF_ERROR_BUSY);
        }
        
        while (app_uart_put(&amp;#39;\r&amp;#39;) == NRF_ERROR_BUSY);
        NRF_LOG_INFO(&amp;quot;Command sent %s (%d)&amp;quot;, version,length-1);
        
    
  }

/*---------------------------------------------------------------------------------------------------------------*/

  if ((p_evt-&amp;gt;type == BLE_NUS_EVT_TX_RDY) &amp;amp;&amp;amp; (isConnected) &amp;amp;&amp;amp; (Report_command_send))
  {
    third_ser = true;
    NRF_LOG_INFO(&amp;quot; Third character should st&amp;quot;);
    //first_ser = false;
    second_ser = false;
    Report_command_send = false;
    size_t length = sizeof(report) / sizeof(report[0]);
    int i;
    uint32_t   err_code;
         memset (lastCommand, 0, 256);
        strncpy (lastCommand, (char *) report,length-1);

        for (i = 0; i &amp;lt; length-1; i++)
        {
            do
            {
                err_code = app_uart_put(report[i]);
               // NRF_LOG_INFO(&amp;quot;Data ver is set to 0x%X(%d)&amp;quot;, report[i],length-1);
                if ((err_code != NRF_SUCCESS) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY))
                {
                    NRF_LOG_ERROR(&amp;quot;Failed receiving NUS message. Error 0x%x. &amp;quot;, err_code);
                    APP_ERROR_CHECK(err_code);
                }
            } while (err_code == NRF_ERROR_BUSY);
        }
        
        NRF_LOG_INFO(&amp;quot;Command sent %s (%d)&amp;quot;, report,length-1);
        while (app_uart_put(&amp;#39;\r&amp;#39;) == NRF_ERROR_BUSY); 
  }
}
  
&lt;/pre&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void services_init(void)
{
    uint32_t           err_code;
    uint32_t           err_code_2;
    ble_nus_init_t     nus_init;
    nrf_ble_qwr_init_t qwr_init = {0};
    //ble_nus_init_2(&amp;amp;m_nus);
   // ble_nus_init_3(&amp;amp;m_nus);
   

    // Initialize Queued Write Module.
    qwr_init.error_handler = nrf_qwr_error_handler;

    err_code = nrf_ble_qwr_init(&amp;amp;m_qwr, &amp;amp;qwr_init);
    APP_ERROR_CHECK(err_code);

    // Initialize NUS.
    memset(&amp;amp;nus_init, 0, sizeof(nus_init));

    nus_init.data_handler = nus_data_handler;
   
    err_code = ble_nus_init(&amp;amp;m_nus, &amp;amp;nus_init);
    APP_ERROR_CHECK(err_code);

    err_code = ble_nus_init_2(&amp;amp;m_nus, &amp;amp;nus_init);
    APP_ERROR_CHECK(err_code);

    err_code = ble_nus_init_3(&amp;amp;m_nus, &amp;amp;nus_init);
    APP_ERROR_CHECK(err_code);
    
  
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HOW TO READ FROM MULTIPLE BLE CHARACTER</title><link>https://devzone.nordicsemi.com/thread/198952?ContentTypeID=1</link><pubDate>Wed, 17 Jul 2019 11:54:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d140b82-53e5-452c-bafe-9bd59af95b21</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please clarify, where do you want your services located ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On the nRF52 or on the Phone ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see any problem having multiple services on the nRF52.&lt;/p&gt;
&lt;p&gt;Please test&amp;nbsp;and verify that it works using nRFConnect before you write your Android app.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HOW TO READ FROM MULTIPLE BLE CHARACTER</title><link>https://devzone.nordicsemi.com/thread/198754?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 13:47:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbb79356-48c2-4739-af1e-45a02cd1ad7e</guid><dc:creator>Nahom</dc:creator><description>&lt;p&gt;ya i saw it. but it is only use one service and two characteristics. I need a sample example for how to read from multiple services which have notifiable characteristics.&lt;/p&gt;
&lt;p&gt;please tell me how to read from multiple services and how can i modified my app_uart nrf52 example for sending data to different services.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HOW TO READ FROM MULTIPLE BLE CHARACTER</title><link>https://devzone.nordicsemi.com/thread/198719?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 12:49:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e94dcd0b-fccf-4ed5-be7c-01203883208d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Nahom,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The Android-nRF-UART is very old code and should not be used. You should use the UART profile inside nRFToolbox instead.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried to test with nRFToolbox ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have the same issue when you test the Android-nRF-UART app with the stock ble_app_uart example ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>