/* Function for comparing two addresses to determine if they are identical.  */
bool addr_compare(ble_gap_addr_t const *p_addr1, ble_gap_addr_t const *p_addr2)
/* Function for comparing two addresses to determine if they are identical.  */
bool addr_compare(ble_gap_addr_t const *p_addr1, ble_gap_addr_t const *p_addr2)
{
    if ((p_addr1 == NULL) || (p_addr2 == NULL))
    {
        return false;
    }
    if (p_addr1->addr_type != p_addr2->addr_type)
    {
        return false;
    }
    return (memcmp(p_addr1->addr, p_addr2->addr, BLE_GAP_ADDR_LEN) == 0);
}