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

in \connect SDK\v1.5.0\nrf\samples\bluetooth\peripheral_uart,data number is limited 20 bytes, more than 20bytes BLE will part data in two or more packs to send or receive

in \connect SDK\v1.5.0\nrf\samples\bluetooth\peripheral_uart,data number is limited 20 bytes, more than 20bytes BLE will part data in two or more packs to send or receive .how can i chang to data number to more bytes. for example , i want to send 200 bytes through COM  in one time and BLE receive 200bytes i one time , relatively HOW to send 200bytes data in one time  through BLE ,not separate 200bytes data in many pack to send

  • in example peripheral_uart of NRF Connect SDK1.5.0 , in main(),the bt_enble() creats two bluetooth threads,a TX thread and a RX thread,you had said these two threads have no effect to program,can these two threads be deleted?what's difference bluetooth host layer thread and APP thread?  in file main.c ,the code  K_THREAD_DEFINE(ble_write_thread_id, STACKSIZE, ble_write_thread, NULL, NULL,
    NULL, PRIORITY, 0, 0); creat ble_write_thread ,but I search whole entire solution ,the word "ble_write_thread_id " has referrenced in only one place   ,how the program know word ble_write_thread_id ?

  • Hi,

    zhouhaifang said:
    you had said these two threads have no effect to program

    No, that is not what I meant. What I mean is that this is part of the implementation of the BLE stack and not something you are mint to modify. 

    zhouhaifang said:
    can these two threads be deleted?

    No.

    zhouhaifang said:
    what's difference bluetooth host layer thread and APP thread?

    There is no fundamental difference, a thread is a thread. But you if you are using the Bluetooth stack, then you do not normally need to think much about how it is implemented. So in a nutshell tx_thread_data() and ble_write_thread_id() as internal details you do not normally need to think about.

    zhouhaifang said:
    in file main.c ,the code  K_THREAD_DEFINE(ble_write_thread_id, STACKSIZE, ble_write_thread, NULL, NULL,
    NULL, PRIORITY, 0, 0); creat ble_write_thread ,but I search whole entire solution ,the word "ble_write_thread_id " has referrenced in only one place   ,how the program know word ble_write_thread_id ?

    All threads need a name/ID as that is a requirement of the Zephyr thread API. However, in this case this is a thread that is crated once and runs forever, so there is no need to refer to it from anywhere else. Therefor, you will not see ble_write_thread_id used anywhere.

  • example peripheral_uart in nrf connect SDK v1.5.0 , i use nrf5340_DK test this example with a bluetooth APP in a phone ,the largest bytes of nrf5340_dk kit can send to app is 20 a time, how can i increase data number ?

    in prj.conf, i  add below:

    CONFIG_BT_USER_DATA_LEN_UPDATE=y
    CONFIG_BT_CTLR_TX_BUFFER_SIZE=251
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

    in att_internal.h , change # define  BT_ATT_DEFAULT_LE_MTU  23   into  # define  BT_ATT_DEFAULT_LE_MTU  43 

    in gap.h , change # define  BT_GAP_DATA_LEN_DEFAULT  0x1b   into # define  BT_GAP_DATA_LEN_DEFAULT  0x2e

    in main.c , chang function uart_cb( ) {.......

    case UART_RX_RDY:
    ......;
    if (buf->len == 30) {...... }

    }

    i only change above ,anther have the same as original example .

     build/debug go ,have no result ,the largest number of ble of nrf5340-dk can send to app of phone is still 20 bytes  ,not 30 bytes  。is there any other code  to be modified in this example? someone said that  nrf connect SDK v1.5.0 need to be updated  to ble5.0 version ,  ble4.0 version can not send more than 20 bytes through ble a time

  • Hi,

    Do you start the data length update procedure by calling bt_conn_le_data_len_update()? Or is it initiated by the peer? If not, then  this is expected.

  • thank  

     I do not know where to insert the function bt_conn_le_data_len_update() ? insert this function in bt_enable() of main.c or in a place of function void main(void)  of main.c  or other  place of flle belonged to this project ?    it is initiated by the peer , peer is a app in phone that will connect NRF5340_DK through ble?  

Related