btdev: check error conditions for HCI_Create_Connection_Cancel
authorPauli Virtanen <pav@iki.fi>
Tue, 1 Aug 2023 16:38:38 +0000 (19:38 +0300)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 13:34:03 +0000 (19:04 +0530)
commit1ab7ce2e416bfc6ae890ddf124b4acdbaf993c7a
treed233e700e6ab7310220dff705095566078c9ba78
parent0130251a0f4197d446325703f81f3c1f5ce311f7
btdev: check error conditions for HCI_Create_Connection_Cancel

Create Connection Cancel shall return Command Complete with error status
when there is no Create Connection that can be canceled.  In these
cases, we should not send a (spurious) Connection Complete event.

Fix by keeping a list of pending Create Connection commands, and
returning command errors if there is none pending at the moment.
emulator/btdev.c
monitor/bt.h