DA14531 advertising data using user_svc1_adc_val_1_cfg_ind_handler

I am trying to send/transmit #define DEF_SVC1_UART_TRANS_LEN 16 data and 5byte of data which i write in LED characteristics using user_svc1_adc_val_1_cfg_ind_handler. But only 16byte is received in BLE receiver.

In user_custs1_impl.c

void user_svc1_adc_val_1_cfg_ind_handler(ke_msg_id_t const msgid,
struct custs1_val_write_ind const *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
struct custs1_val_ntf_ind_req *req = KE_MSG_ALLOC_DYN(CUSTS1_VAL_NTF_REQ,
prf_get_task_from_id(TASK_ID_CUSTS1),
TASK_APP,
custs1_val_ntf_ind_req,
DEF_SVC1_ADC_VAL_1_CHAR_LEN);

// ADC value to be sampled
memset(c_buffer, 48, sizeof(c_buffer));                                                      // I am firsr initailising the buffer data to zero
memcpy(c_buffer, buffer, sizeof(buffer));                                                    // I am copying the uart buffer[16] data in c_buffer[21]. I assume the data in c_buffer[16-21] is zero
memcpy(&c_buffer[16], buffer2, sizeof(buffer2));                                      // I am now copying LED write data in c_buffer[16-21]
req->conidx = app_env->conidx;
req->notification = true;
req->handle = SVC1_IDX_ADC_VAL_1_VAL;                                       // This length i have kept as 21byte where 16byte data i will send using uart and 5byte data i will write in LED   
req->length = DEF_SVC1_UART_TRANS_LEN;                                     characteristics and append it in data[16] to data[20]
memcpy(req->value, calibrated_buffer, DEF_SVC1_UART_TRANS_LEN);

ke_msg_send(req);

if (ke_state_get(TASK_APP) == APP_CONNECTED)
{
// Set it once again until Stop command is received in Control Characteristic
timer_used = app_easy_timer(APP_PERIPHERAL_CTRL_TIMER_DELAY, app_adcval1_timer_cb_handler);
}
}

req->conidx = app_env->conidx;
req->notification = true;
req->handle = SVC1_IDX_ADC_VAL_1_VAL;
req->length = DEF_SVC1_UART_TRANS_LEN;                                               memcpy(req->value, &buffer, DEF_SVC1_UART_TRANS_LEN);             

ke_msg_send(req);

if (ke_state_get(TASK_APP) == APP_CONNECTED)
{
// Set it once again until Stop command is received in Control Characteristic
timer_used = app_easy_timer(APP_PERIPHERAL_CTRL_TIMER_DELAY, app_adcval1_timer_cb_handler);
}
}

Last time i faced the same issue while transmitting 15byte of data. That time i made a mistake in transmitting length size which was 10. I increased the size to 15 and it worked fine. In the above case, i am facing the same issue, only while advertising for the first time, i receive 21byte data, from 2nd data onwards only16byte data is transferred.

Parents Reply Children
No Data