This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Regarding ble_app_uart

Dear nordic,

I have some doubts regarding ble nus service.

1. how many bytes i can transfer in one packet t a time from smart phone to nrf52832 viceversa?

2. Is it any source code available for nrf connect,nrf UART android apps?

  i tested the ble app_uart nrf uart support only 20 byte at a time but nrf connect support more than 20 bytes how many byte i can transfer one time using these app?

Parents
  • Hi Alan

    1. The nRF52832 can transfer up to 247 bytes per packet using extended MTU. However, since the peripheral can do up to 247 bytes does not automatically mean that the smartphone will also accept this MTU size. You might get 64 bytes (or 23 bytes) once the link between the peripheral and central is established. In order to satisfy the size as given by the smartphone, you can store the agreed upon MTU size, which will be located in the callback for the GATT handler module (here taken from the ble_app_hrs example in SDK 15):

    /**@brief GATT module event handler.
     */
    static void gatt_evt_handler(nrf_ble_gatt_t * p_gatt, nrf_ble_gatt_evt_t const * p_evt)
    {
        if (p_evt->evt_id == NRF_BLE_GATT_EVT_ATT_MTU_UPDATED)
        {
            NRF_LOG_INFO("GATT ATT MTU on connection 0x%x changed to %d.",
                         p_evt->conn_handle,
                         p_evt->params.att_mtu_effective);
        }
    
        ble_hrs_on_gatt_evt(&m_hrs, p_evt);
    }

    2. Sorry, but nRFConnect was made as a tool for developers, and is not an example meant to be modified, so the source code is not available I'm afraid. Instead I suggest you have a look at our Android BLE Library over at GitHub.

    Best regards,

    Simon

Reply
  • Hi Alan

    1. The nRF52832 can transfer up to 247 bytes per packet using extended MTU. However, since the peripheral can do up to 247 bytes does not automatically mean that the smartphone will also accept this MTU size. You might get 64 bytes (or 23 bytes) once the link between the peripheral and central is established. In order to satisfy the size as given by the smartphone, you can store the agreed upon MTU size, which will be located in the callback for the GATT handler module (here taken from the ble_app_hrs example in SDK 15):

    /**@brief GATT module event handler.
     */
    static void gatt_evt_handler(nrf_ble_gatt_t * p_gatt, nrf_ble_gatt_evt_t const * p_evt)
    {
        if (p_evt->evt_id == NRF_BLE_GATT_EVT_ATT_MTU_UPDATED)
        {
            NRF_LOG_INFO("GATT ATT MTU on connection 0x%x changed to %d.",
                         p_evt->conn_handle,
                         p_evt->params.att_mtu_effective);
        }
    
        ble_hrs_on_gatt_evt(&m_hrs, p_evt);
    }

    2. Sorry, but nRFConnect was made as a tool for developers, and is not an example meant to be modified, so the source code is not available I'm afraid. Instead I suggest you have a look at our Android BLE Library over at GitHub.

    Best regards,

    Simon

Children
No Data
Related