changing connection interval

6 posts / 0 new
Last post
Yinling
Offline
Last seen:6 years 5 months ago
加入:2014-06-05 10:46
changing connection interval

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;

PY_Dialog
Offline
Last seen:2 years 10 months ago
工作人员
加入:2014-08-25 09:59
Hi Yinling,

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

summer20100514
Offline
Last seen:4 years 4 months ago
Guru
加入:2014-12-30 05:01
Hi, PY_Dialog, you said in

Hi, PY_Dialog, you said in step 2 that the application should

wait for 2-3 seconds

can you explain the reason of doing this?

Yinling
Offline
Last seen:6 years 5 months ago
加入:2014-06-05 10:46
Dear PY,

Dear PY,

I've tested your solution and it works fine. Thanks for your help.

Best Regards
Yinling

mohit3112
Offline
Last seen:9 months 6 days ago
Expert
加入:2014-08-04 13:45
Hi ,

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

Joacimwe
Offline
Last seen:1 year 5 months ago
Guru
加入:2014-01-14 06:45
In app_task.c in gapc_cmp_evt

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.