BT_DEVICE_MODULE, __bt_device_event_handler);
}
-void __bt_device_handle_pending_requests(int result, int service_function,
+static void __bt_device_handle_pending_requests(int result, int service_function,
void *user_data, unsigned int size)
{
GSList *l;
}
break;
}
- case BT_BOND_DEVICE: {
+ case BT_BOND_DEVICE:
+ case BT_BOND_DEVICE_BY_TYPE: {
char *address = (char *)user_data;
if (strncmp((char*)req_info->user_data, address, BT_ADDRESS_STRING_SIZE)) {
BT_ERR("Unexpected: Info request pending for a different address!!");
BT_DBG("-");
}
+static void __bt_device_handle_pending_bond_requests(int result,
+ void *user_data, unsigned int size)
+{
+ __bt_device_handle_pending_requests(result, BT_BOND_DEVICE,
+ trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
+ __bt_device_handle_pending_requests(result, BT_BOND_DEVICE_BY_TYPE,
+ trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
+}
+
/*
* Remote device properties are received on all following conditions
* a. When Bonding in on-going
if (_bt_device_get_bonded_device_info(&dev_addr) == BLUETOOTH_ERROR_NONE) {
BT_DBG("Bonded device info query posted to stack successfully");
- __bt_device_handle_pending_requests(BLUETOOTH_ERROR_NONE, BT_BOND_DEVICE,
+ __bt_device_handle_pending_bond_requests(BLUETOOTH_ERROR_NONE,
trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
} else {
BT_DBG("Possibly internal stack error in bonded device info query, perform cleanup");
- __bt_device_handle_pending_requests(BLUETOOTH_ERROR_INTERNAL, BT_BOND_DEVICE,
+ __bt_device_handle_pending_bond_requests(BLUETOOTH_ERROR_INTERNAL,
trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
/* Destroy if at all device got bonded at stack level */
device_destroy_bond((bt_address_t *)trigger_bond_info->dev_addr);
ret = device_create_bond((bt_address_t *)trigger_bond_info->dev_addr, trigger_bond_info->conn_type);
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("Create Bond procedure could not suceed");
- __bt_device_handle_pending_requests(BLUETOOTH_ERROR_INTERNAL, BT_BOND_DEVICE,
+ __bt_device_handle_pending_bond_requests(BLUETOOTH_ERROR_INTERNAL,
trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
__bt_free_bond_info(BT_DEVICE_BOND_INFO);
__bt_free_pairing_info(&trigger_pairing_info);
} else {
#endif
BT_ERR("Create Bond failed MAX_BOND_RETRY_COUNT TIMES!!");
- __bt_device_handle_pending_requests(BLUETOOTH_ERROR_INTERNAL, BT_BOND_DEVICE,
+ __bt_device_handle_pending_bond_requests(BLUETOOTH_ERROR_INTERNAL,
trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
__bt_free_bond_info(BT_DEVICE_BOND_INFO);
__bt_free_pairing_info(&trigger_pairing_info);
BT_ERR("Bonding is cancelled by user");
result = BLUETOOTH_ERROR_CANCEL_BY_USER;
}
- __bt_device_handle_pending_requests(result, BT_BOND_DEVICE,
+ __bt_device_handle_pending_bond_requests(result,
trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
__bt_free_bond_info(BT_DEVICE_BOND_INFO);
}
BT_INFO("OAL_STATUS_ALREADY_CONNECT");
if (trigger_bond_info) {
- __bt_device_handle_pending_requests(result, BT_BOND_DEVICE,
- trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
+ __bt_device_handle_pending_bond_requests(result,
+ trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
__bt_free_bond_info(BT_DEVICE_BOND_INFO);
}
break;
} else if (trigger_bond_info) {
if (__bt_device_handle_bond_state() != BLUETOOTH_ERROR_NONE) {
if (trigger_bond_info) {
- __bt_device_handle_pending_requests(BLUETOOTH_ERROR_INTERNAL, BT_BOND_DEVICE,
+ __bt_device_handle_pending_bond_requests(BLUETOOTH_ERROR_INTERNAL,
trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
__bt_free_bond_info(BT_DEVICE_BOND_INFO);
}
So lets cleanup the context */
if (ret != OAL_STATUS_SUCCESS) {
BT_ERR("Create Bond procedure could not suceed");
- __bt_device_handle_pending_requests(BLUETOOTH_ERROR_INTERNAL, BT_BOND_DEVICE,
+ __bt_device_handle_pending_bond_requests(BLUETOOTH_ERROR_INTERNAL,
trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
__bt_free_bond_info(BT_DEVICE_BOND_INFO);
__bt_free_pairing_info(&trigger_pairing_info);
case BT_DEVICE_BOND_STATE_NONE:
BT_INFO("Create Bond failed!!");
if (trigger_bond_info) {
- __bt_device_handle_pending_requests(BLUETOOTH_ERROR_INTERNAL, BT_BOND_DEVICE,
+ __bt_device_handle_pending_bond_requests(BLUETOOTH_ERROR_INTERNAL,
trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
__bt_free_bond_info(BT_DEVICE_BOND_INFO);
__bt_free_pairing_info(&trigger_pairing_info);