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

Ble

Dear sir,

Sir I am trying to send an array of 40 values via nrf51422 to your andriod app "BLE SCANNER" by using the function "ble_nus_string_send". But it is sending only first six values. So please tell me how shall send the all the 40 values.

Regards,

Manoj Hiwarkar

Parents
  • Hi Manoj Hiwarkar,

    ble limitation : send 20 bytes and receive 20 bytes.

    Not sure what data type your 40 values are but the commonly used data type is bytes.

    So byte array[20] will be the max transfer limit over ble and likewise ble will only receive bytes[20] at a given time.

    There are ways on how you could send/receive data more than 20 bytes long.

    https://devzone.nordicsemi.com/f/nordic-q-a/553/dealing-large-data-packet-s-through-ble

    I would recommend using nRFToolbox or nRF Connect for uart service, just because it's more efficient.

    And you have mentioned your receiving only 6 values? So what data type are you trying to send?

  • Sir I am sending the values one by one & not at a time.The maximum size of one value is only 2 byte. Is there pointer value that we can change. Especially "&m_nus" 

  • Hello 

    Have you modified anything inside ble_nus_string_send? If you look inside this function, what is your BLE_NUS_MAX_DATA_LEN? I assume it is larger than 20, since you do not reveice NRF_ERROR_INVALID_PARAM, but can you check what it is?

    Can you also check in sdk_config.h, what is the value of NRF_SDH_BLE_GATT_MAX_MTU_SIZE?

    Also, if you used the ble_app_uart example, I assume you have the function gatt_init() in main.c. What parameters do you pass into nrf_ble_gatt_att_mtu_periph_set() inside gatt_init()?

    And lastly, can you check inside gatt_evt_handler(), it should set

    m_ble_nus_max_data_len = p_evt->params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;

    Can you check what m_ble_nus_max_data_len is after this event? Try to print it in the RTT-log, or using printf for the uart.

    Best regards,

    Edvin

Reply
  • Hello 

    Have you modified anything inside ble_nus_string_send? If you look inside this function, what is your BLE_NUS_MAX_DATA_LEN? I assume it is larger than 20, since you do not reveice NRF_ERROR_INVALID_PARAM, but can you check what it is?

    Can you also check in sdk_config.h, what is the value of NRF_SDH_BLE_GATT_MAX_MTU_SIZE?

    Also, if you used the ble_app_uart example, I assume you have the function gatt_init() in main.c. What parameters do you pass into nrf_ble_gatt_att_mtu_periph_set() inside gatt_init()?

    And lastly, can you check inside gatt_evt_handler(), it should set

    m_ble_nus_max_data_len = p_evt->params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;

    Can you check what m_ble_nus_max_data_len is after this event? Try to print it in the RTT-log, or using printf for the uart.

    Best regards,

    Edvin

Children
Related