William San Filippo created MYNEWT-388:
------------------------------------------

             Summary: BLE HCI code asserts when it cannot allocate buffers for 
commands and ACL data packets
                 Key: MYNEWT-388
                 URL: https://issues.apache.org/jira/browse/MYNEWT-388
             Project: Mynewt
          Issue Type: Bug
    Affects Versions: v0_9_0
            Reporter: William San Filippo
             Fix For: v1_0_0_beta1


The BLE HCI was asserting when it could not allocate a buffer for a command 
and/or  an ACL data packet. The proper behavior as per the specification is the 
following:

1) If no ACL buffer is available the controller should send the data buffer 
overflow event.
2) The spec is not quite clear as to what should be done if there is no command 
buffer available. This should not happen but if it does, we should not assert. 
In this case, our controller will skip the command and simply not reply. Not 
sure what else could be done in this case.

The other issue with the HCI code was loss of sync. The spec dictates that a HW 
error should be sent on loss of sync. Loss of sync occurs when either an 
invalid HCI packet type is seen or a HCI packet length is out of range.

The code will now send a HW error when loss of sync occurs. Note that we only 
check ACL data packets for correct length; we dont check commands.

A final note: these changes are only for the controller only implementation 
currently. The host only implementation need to be done.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to