I have used similar connection parameters successfully with an iPhone master, so I would suspect the bug is in the master, not the slave. It may be that the master doesn't like your parameter selections for whatever reason. The master is not obligated to accept the parameters the slave requests, so I don't know if you can technically call it a bug, but it doesn't seem right. I'm using SDK 2.2.1 also.
Yes the problem is on the master, but I'm also using SDK2.2.1 on the master. From the debug trace of the master you can see that slave latency and timeout are both zero while the slave sends those as 1, 600 and those are confirmed with the sniffer trace
Here is the Wiced-smart function in question:
int blecenhandleConnParamUpdateReq(LEL2CAP_HDR *l2capHdr)
LEL2CAP_COMMAND_HDR *cmdPkt = (LEL2CAP_COMMAND_HDR *) l2capHdr;
extern void lel2cap_sendConnParamUpdateRsp(UINT16 identifier, UINT16 result);
TRACE(TRACE_INFO, MODULE_ID_BLEAPP, "ConnParamUpdateReq", TVF_D(0));
if(cmdPkt->len == 8)
LEL2CAP_CMD_CONN_PARAM_UPDATE_REQ *req =
(LEL2CAP_CMD_CONN_PARAM_UPDATE_REQ *) (&(cmdPkt->code));
TRACE(TRACE_INFO, MODULE_ID_BLEAPP, "ConnParamUpdate:Min Interval: %d, Max Interval: %d", TVF_WW(req->minInterval, req->maxInterval));
TRACE(TRACE_INFO, MODULE_ID_BLEAPP, "ConnParamUpdate: Slave LAtency: %d, timeout: %d", TVF_WW(req->slaveLatency, req->timeout));
lel2cap_sendConnParamUpdateRsp(req->identifier, 0); //always accept
The problem is the the req->slaveLatency and req->timeout are not correct. Note I've also tested this by modifying all four parameters and the minInterval and maxInterval are updated correctly but the other two seems to be always zero.
It seems that the *l2capHdr is not filled out with the received data from the caller.
I've enabled cfa_mm_MemFreeBytes() and blecm_DidStackOverflow() to see if this is related to some stack issue. There's plenty of free memory and no overflows.
Anyone else see the master not getting the correct parameters?
Thanks JT. That works!