Other Parts Discussed in Thread: CC2541
My peripheral devices disconnect immediately after forming a connection. This is caused by trying to look up the identity resolving keys (IRK) for private MAC addresses. I have an iOS and and Android app, and this problem only occurs on iOS. The important difference is that iOS uses a private address type, and Android is public. By commenting out gapBondMgrResolvePrivateAddr in gapbondmgr.c, the connection problem no longer occurs. The problem only happens when I write to OSAL SNV many times. My devices occasionally update 3 variables that I want backed up in nonvolatile memory. They are updated rarely, but to recreate the problem I accelerated all activities and the problem does not occurs without backing these variables up. My theory is that gapBondMgrResolvePrivateAddr spends too much time sorting through OSAL SNV for the IRKs and it misses packets.
The problem goes away after a few days. The OSAL SNV will clean itself up by moving all saved items to a new page. This speeds up gapBondMgrResolvePrivateAddr and connections can be made (I assume).
Connections do form consistently. The perpheral state notification callback is triggered, and the new state is GAPROLE_CONNECTED. I make an LED blink when this happens. I can see on the packet sniffer that the slave only responds with one packet in the connection.
My devices do not use saved IRKs (that I know of). Is it safe to comment out gapBondMgrResolvePrivateAddr in GAPBondMgr_ResolveAddr?
I am using a CC2541