Dear Dialog,
I need to enlarge connection interval to decrease power consumption. Current on my PCB is around 20 uA when advertising, 250 uA when connected with iphone without transferring any data.
I'm using proximity reporter_fh demo project. I modified connection intervals in app_configuration_func of app_proxr_proj.c . I used the following configurations but total current always stay at 250uA. It seems does not work.
Please help me with this issue. Thanks!
//setting 1
// Slave preferred Minimum of connection interval
cmd->con_intv_min = 8; // 10ms (8*1.25ms)
// Slave preferred Maximum of connection interval
cmd->con_intv_max = 16; // 20ms (16*1.25ms)
// Slave preferred Connection latency
cmd->con_latency = 0;
// Slave preferred Link supervision timeout
cmd->superv_to = 100;
//setting 2
// Slave preferred Minimum of connection interval
cmd->con_intv_min = 200; // 10ms (8*1.25ms)
// Slave preferred Maximum of connection interval
cmd->con_intv_max = 250; // 20ms (16*1.25ms)
// Slave preferred Connection latency
cmd->con_latency = 0;
// Slave preferred Link supervision timeout
cmd->superv_to = 400;
Hi Yinling,
You can not use preferred connection interval to request a different set of connection parameters for certain master devices. Alternatively, you can send GAPC_PARAM_UPDATE_CMD to negotiate interval with master.
What you need to do:
1. establish a connection
2. wait for 2 -3 seconds
3. send a connection parameter update request:
void app_param_update_func(void)
{ struct gapc_param_update_cmd * req = KE_MSG_ALLOC(GAPC_PARAM_UPDATE_CMD, TASK_GAPC, TASK_APP, gapc_param_update_cmd); // Fill in the parameter structure
req->operation = GAPC_UPDATE_PARAMS; req->params.intv_min = 200; // N * 1.25ms
req->params.intv_max = 250; // N * 1.25ms
req->params.latency = 0; // Conn Events skipped
req->params.time_out = 400; // N * 10ms
ke_msg_send(req);
return;
}
Also, the master device need to accept the new parameter. Or else the link will be terminated.
Hope this help you!
Regards!
PY
Hi, PY_Dialog, you said in step 2 that the application should
can you explain the reason of doing this?
Dear PY,
I've tested your solution and it works fine. Thanks for your help.
Best Regards
Yinling
Hi ,
I have tested the above method it works fine for me but , I am not receiving GAPC_CMP_EVT , so app_update_param_complete_func in app_template_proj.c is not executing ? can you tell me what might be going wrong
Thanks
Mohit
In app_task.c in gapc_cmp_evt_handler under GAPC_UPDATE_PARAMS, you will see that app_update_param_complete_func is only called if the state of TASK_APP is set to APP_PARAM_UPD. Therefore you should either remove this if-statement or add ke_state_set(dest_id, APP_PARAM_UPD); in your app_param_update_func.