Hello,
we are using the DA14580 with the SDK 5.0.4.
We can connect any Smartphone as Central device with the DA14580 as Peripheral device.
We would like to store the Smartphone Hardware ID ("MAC"-Address) in our module to differentiate between known and unknown Smartphones.
The idea was:
- Pairing mode is "Just works" since there is no possibility for key exchange.
- let the central device do the connection
- check the central device 6-byte-address in the DA14580
- disconnect if central device not known
This works fine for Android phones which send a fixed 6-byte address with the connection request (newer Android versions may change the address, too).
But with iPhones the adress changes over time and the identification fails.
as I have figured out so far, the connection request is processed in the SDK in the following method:
void user_on_connection(uint8_t connection_idx, struct gapc_connection_req_ind const *param) { ... }
which receives a information struct as follows:
struct gapc_connection_req_ind {
uint16_t conhdl; /// Connection handle
uint16_t con_interval; /// Connection interval
uint16_t con_latency; /// Connection latency
uint16_t sup_to; /// Link supervision timeout
uint8_t clk_accuracy; /// Clock accuracy
uint8_t peer_addr_type; /// Peer address type
struct bd_addr peer_addr; /// Peer BT address
};
with the peer address being the 6 byte address sent by the connecting Smartphone.
So this address is the only data we can "work with" in our code.
Questions are:
- is it right that the DA14580 gets only the 6-byte peer_addr as information when receiving a connection request? Or is there more to work with?
- Peer address types may be "public" or "private random"?
- what is the recommended way to identify a Central device (Smartphone) which changes the address over time?