[ 
https://issues.apache.org/jira/browse/MYNEWT-842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16208266#comment-16208266
 ] 

ASF subversion and git services commented on MYNEWT-842:
--------------------------------------------------------

Commit 76bfc3ba0d85ab591c97ba54728d5c3fa0669b57 in mynewt-core's branch 
refs/heads/master from [~ccollins476]
[ https://gitbox.apache.org/repos/asf?p=mynewt-core.git;h=76bfc3b ]

MYNEWT-842 BLE Host - Stop GAP, add to rslv list

If an attempt to add a peer's IRK to the resolving list fails, the
failure is not reported, and the operation is not reattempted. Adding to
the resolving list fails if the host is scanning or advertising at the
time, so this is a common occurrence.

This commit address this problem as follows.  Before attempting to add
an entry to the resolving list, the host stops all active GAP
procedures.  After the entry has been successfully added, the
application must restart interrupted procedures as needed.

Interrupted procedures are reported with a reason or status code of
`BLE_HS_EPREEMPTED`.  Furthermore, an attempt to initiate a new GAP
procedure during preemption fails with a return code of
`BLE_HS_EPREEMPTED`.

There is one additional requirement which complicates this feature:
interrupted procedures must not be reported until after preemption has
ended.  That way, the application can restart the procedure immediately
upon receiving the event.  This requirement implies a somewhat strange
order of events when an entry is added to the resolving list:

1. Set the preempted state.
2. Abort all GAP procedures, but don't report anything.
3. Add the entry to the resolving list.
4. Clear the preempted state.
5. Finally, report interrupted procedures.

The implementation is further complicated by the nature of the
'cancel-create-connection' HCI exchange.  The cancel operation can be
considered complete as soon as the command-complete event is received,
but it does not get reported until the subsequent
'le-connection-complete' event is received.  For this reason, the GAP
must stay in the preempted state indefinitely until the expected event
is received.


> BLE Host - Handle failure to add entry to resolving list
> --------------------------------------------------------
>
>                 Key: MYNEWT-842
>                 URL: https://issues.apache.org/jira/browse/MYNEWT-842
>             Project: Mynewt
>          Issue Type: Bug
>      Security Level: Public(Viewable by anyone) 
>          Components: Nimble
>            Reporter: Christopher Collins
>            Assignee: Christopher Collins
>             Fix For: v1_3_0_rel
>
>
> (Pull request: https://github.com/apache/mynewt-core/pull/596)
> If an attempt to add a peer's IRK to the resolving list fails, the failure is 
> not reported, and the operation is not reattempted.  Adding to the resolving 
> list fails if the host is scanning or advertising at the time, so this is a 
> common occurrence.
> I am not sure what the best solution is to this problem.  I have a few ideas 
> (order of increasing complexity):
> 1. The host stops all active GAP procedures before trying to add the entry to 
> the resolving list.  The application must restart interrupted procedures as 
> needed.
> 2. The host passes the necessary information up to the application.  It is 
> then up to the application to populate the resolving list when possible (or 
> not).
> 3. The host remembers the failed attempt and retries when in a suitable state 
> (i.e., when advertising, scanning, and connecting has stopped).
> 4. The host temporarily suspends all GAP activity, adds the entry to the 
> resolving list, and resumes GAP activity.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to