When notification with big data, only maximum 4 notification is sent.

Dear Nordic support team,
I meet a situation: I have big data array need to transfer("arrayTransfer" with 3072 bytes)
to smart phone by notification method. Using timer 10s to send 3072 byte to smart phone.

I want to send 128 bytes data for one notification.

So I have to separate "arrayTransfer" to small array (128 bytes each notification).

It mean with 3072 byte we need send 24 notifies to smart phone.

I see that on our App only receive 4 notifies instead 24.

If I change separate "arrayTransfer" to small array (32 bytes each notification).

It mean with 3072 byte we need send 96 notifies to smart phone.

But we also only receive 4 notifies instead 96.

=> Why we only send maximum 4 time notification?

     I try with change number of notification byte: 128byte/32bytes/8bytes/... The same result, we on ly maximum 4 notifications is sent to smartphone.

=> How to change the maximum notification send? Can you see and help me review the "dataTransferHandler" function below.

thanks and best regards,

   



Here is my function code in the "main.c"

uint8_t arrayTransfer[3072]; 

void initArray(void)
{
 uint8_t i, j;
    for(i =0; i<24; i++)
    {
        for(j = 0; j< 128; j++)
        {
            arrayTransfer[i*loop2 + j] = j;
        }
    }
 
}
static void dataTransferHandler(void * p_context)
{

    UNUSED_PARAMETER(p_context);
    uint8_t dataTransfer[128];
    uint8_t dataLengthTransfer = sizeof(dataTransfer), i, j;
    ret_code_t err_code;
    

    for(i = 0; i< 24; i++)
    {
        for(j = 0; j<128; j++)
        {
            dataTransfer[j] = arrayTransfer[i*128+j+i];
        }
        err_code = ble_TWIs_temperature_update(&m_TWIs, dataTransfer, BLE_CONN_HANDLE_ALL, dataLengthTransfer);
    }


    if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_INVALID_STATE) &&
        (err_code != NRF_ERROR_RESOURCES) && (err_code != NRF_ERROR_BUSY) &&
        (err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING))
    {
        APP_ERROR_HANDLER(err_code);
    }
}



int main(void)
{
    bool erase_bonds;
    ret_code_t err_code;
    // Initialize.
    log_init();
    timers_init();
    initArray();
    ......
}


Related