ipc_send_notif(HAL_SERVICE_ID_PAN, HAL_EV_PAN_CONN_STATE, sizeof(ev),
&ev);
+ if (dev->conn_state == HAL_PAN_STATE_DISCONNECTED)
+ pan_device_free(dev);
}
static void bt_pan_notify_ctrl_state(struct pan_device *dev, uint8_t state)
bnep_if_down(dev->iface);
bnep_conndel(&dev->dst);
bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED);
- pan_device_free(dev);
return FALSE;
}
error("bnep connect req failed: %s", strerror(-err));
bnep_conndel(&dev->dst);
bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED);
- pan_device_free(dev);
return;
}
fail:
bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED);
- pan_device_free(dev);
}
static void bt_pan_connect(const void *buf, uint16_t len)
}
dev = l->data;
-
if (dev->watch) {
g_source_remove(dev->watch);
dev->watch = 0;
bnep_if_down(dev->iface);
bnep_conndel(&dst);
-
bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED);
- pan_device_free(dev);
-
status = HAL_STATUS_SUCCESS;
failed: