I am trying to send/transmit #define DEF_SVC1_ADC_VAL_1_CHAR_LEN 21 byte of data in the below service. But only 20byte data is displayed in that service. Is it possible to advertise data which is more than 20byte???
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 sampledmemset(c_buffer, 48, sizeof(c_buffer)); // I am firsr initailising the buffer data to zeromemcpy(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 zeromemcpy(&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_ADC_VAL_1_CHAR_LEN; characteristics and append it in data[16] to data[20]memcpy(req->value, calibrated_buffer, DEF_SVC1_ADC_VAL_1_CHAR_LEN);ke_msg_send(req);if (ke_state_get(TASK_APP) == APP_CONNECTED){// Set it once again until Stop command is received in Control Characteristictimer_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_ADC_VAL_1_CHAR_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 Characteristictimer_used = app_easy_timer(APP_PERIPHERAL_CTRL_TIMER_DELAY, app_adcval1_timer_cb_handler);}}
Hi Surya,
Thanks for your post. Please find more details in this post : https://community.renesas.com/wireles-connectivity/f/bluetooth-low-energy/28740/da14531-advertising-data-using-user_svc1_adc_val_1_cfg_ind_handler
You will need to increase the MTU size.
Regards,
PM_Renesas