Hi Tim,
On Thu, Sep 01, 2016 at 10:02:00AM +0100, Tim Hutt wrote:
> Hmm well I didn't get the ble_gap_update_params() version to work,
Is the host providing any feedback at all regarding the outcome of the
procedure? Here is the sequence of events that I would expect:
1. Application calls ble_gap_update_params()
2. Host informs application of the procedure outcome via a call to the
gap event callback with the following parameters:
* event.type: BLE_GAP_EVENT_CONN_UPDATE
* conn_update.status: indicates whether the peer accepted or
rejected the request.
If the peer accepted the request, then the application can determine the
updated connection parameters by inspecting corresponding connection
descriptor (via a call go ble_gap_conn_find()). This is necessary
because the master device doesn't have to use the exact parameters that
the slave requested.
I wondering if you are seeing a bug in the NimBLE host, or if the Xperia
device is not behaving as the NimBLE controller expects it to. Do you
happen to know which link-layer PDUs get exchanged when you initiate the
procedure?
> but I did get ble_l2cap_sig_update() to work! The key is to *not*
> enabled the BLE_LL_CFG_FEAT_CONN_PARAM_REQ feature. If I had that
> enabled, the slave sent an L2CAP Connection Parameter Update Request,
> and the master replied with an L2CAP Connection Parameter Update
> Response, saying they were accepted, but then the parameters didn't
> actually change. If you disable the feature, then instead of replying
> with an L2CAP Connection Parameter Update Response message, it sends a
> LL_CONNECTION_UPDATE_IND packet that actually changes the parameters.
Ah, that makes sense. There is some wording in the spec that I hadn't
noticed earlier. This excerpt from the spec describes the L2CAP
connection parameter update request (Vol. 3, Part A, 4.20):
This command shall only be sent from the LE slave device to the LE
master device and only if one or more of the LE slave Controller, the LE
master Controller, the LE slave Host and the LE master Host do not
support the Connection Parameters Request Link Layer Control Procedure
([Vol. 6] Part B, Section 5.1.7).
So the NimBLE host really isn't doing its job here. The
ble_gap_update_params() should do something like this:
1. If master: send LE Connection Update HCI command to controller.
2. Else (slave):
a. If both peers support the CPRLLC procedure: send LE Connection
Update HCI command to controller
b. Else: Send the L2CAP Connection Parameter Update Request.
We'll need to get this fixed in the NimBLE host.
Thanks,
Chris