We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcc61ae commit 9985a09Copy full SHA for 9985a09
drivers/bluetooth/hci/userchan.c
@@ -360,8 +360,28 @@ static int uc_open(const struct device *dev, bt_hci_recv_t recv)
360
return 0;
361
}
362
363
+static int uc_close(const struct device *dev)
364
+{
365
+ struct uc_data *uc = dev->data;
366
+ int rc;
367
+
368
+ if (uc->fd < 0) {
369
+ return -ENETDOWN;
370
+ }
371
372
+ rc = nsi_host_close(uc->fd);
373
+ if (rc < 0) {
374
+ return -nsi_errno_from_mid(-rc);
375
376
377
+ uc->fd = -1;
378
379
+ return 0;
380
+}
381
382
static DEVICE_API(bt_hci, uc_drv_api) = {
383
.open = uc_open,
384
+ .close = uc_close,
385
.send = uc_send,
386
};
387
0 commit comments