sizeof(uint32_t), &remote_cod);
if (btif_storage_get_remote_device_property((bt_bdaddr_t *)remote_bdaddr, &prop_name) == BT_STATUS_SUCCESS)
{
+ BTIF_TRACE_ERROR2("%s: remote_cod = 0x%06x", __FUNCTION__, remote_cod);
if ((remote_cod & 0x7ff) == cod)
return TRUE;
}
if (btif_storage_get_remote_device_property((bt_bdaddr_t *)remote_bdaddr,
&prop_name) == BT_STATUS_SUCCESS)
{
+ BTIF_TRACE_DEBUG2("%s: remote_cod = 0x%06x", __FUNCTION__, remote_cod);
if ((remote_cod & 0x700) == cod)
return TRUE;
}
/* class of device */
cod = devclass2uint(dev_class);
+ BTIF_TRACE_DEBUG2("%s():cod is 0x%06x", __FUNCTION__, cod);
if ( cod == 0) {
- BTIF_TRACE_DEBUG1("%s():cod is 0, set as unclassified", __FUNCTION__);
- cod = COD_UNCLASSIFIED;
+ /* Try to retrieve cod from storage */
+ BTIF_TRACE_DEBUG1("%s():cod is 0, checking cod from storage", __FUNCTION__);
+ BTIF_STORAGE_FILL_PROPERTY(&properties[num_properties],
+ BT_PROPERTY_CLASS_OF_DEVICE, sizeof(cod), &cod);
+ status = btif_storage_get_remote_device_property(&bdaddr, &properties[num_properties]);
+ BTIF_TRACE_DEBUG2("%s():cod retreived from storage is 0x%06x", __FUNCTION__, cod);
+ if ( cod == 0) {
+ BTIF_TRACE_DEBUG1("%s():cod is again 0, set as unclassified", __FUNCTION__);
+ cod = COD_UNCLASSIFIED;
+ }
}
BTIF_STORAGE_FILL_PROPERTY(&properties[num_properties],
case HCI_ERR_UNIT_KEY_USED:
case HCI_ERR_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED:
case HCI_ERR_INSUFFCIENT_SECURITY:
- BTIF_TRACE_DEBUG1(" %s() Authentication fail ", __FUNCTION__);
+ case HCI_ERR_PEER_USER:
+ case HCI_ERR_UNSPECIFIED:
+ BTIF_TRACE_DEBUG2(" %s() Authentication fail reason %d",
+ __FUNCTION__, p_auth_cmpl->fail_reason);
if (pairing_cb.autopair_attempts == 1)
{
BTIF_TRACE_DEBUG1("%s(): Adding device to blacklist ", __FUNCTION__);