The HCI specification creates additional complexity to allow this
configuration:
- When a connection gets established, we need to know which
identity the HCI_LE_Connection_Complete event corresponds to.
- The identity is a property of the advertising set.
Therefore we need the advertising handle.
- The advertising handle is part of the
HCI_LE_Advertising_Set_Terminated event and is not part of
the HCI_LE_Connection_Complete event. Therefore
the information of both events needs to be combined.
By spec the LE_Connection_Complete comes first. Therefore we cache
this event until the identity is available.
The event is only cached when a connection gets established as
that is the only case where we need to resolve the identity.
As the caching requires more resources, it is only enabled if the
application requires multiple advertising sets and multiple
identities.
The host maps the HCI_LE_Advertising_Set_Terminated event with
the HCI_LE_Connection_Complete event by comparing the connection
handles.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>