diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-03-04 17:22:21 -0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-03-07 17:18:37 -0800 |
commit | 942a73daca6e62765a682fa794a859224fb9f3c2 (patch) | |
tree | d13374abdc700a49e9807625e5326ba6554a04a7 /emulator | |
parent | 3250d7f938831eb583284d46e05338ada1ef729e (diff) | |
download | bluez-942a73daca6e62765a682fa794a859224fb9f3c2.tar.gz |
btdev: Implement BT_HCI_CMD_LE_PERIODIC_ADV_TERM_SYNC
This adds implementation of BT_HCI_CMD_LE_PERIODIC_ADV_TERM_SYNC.
Diffstat (limited to 'emulator')
-rw-r--r-- | emulator/btdev.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/emulator/btdev.c b/emulator/btdev.c index 09101a5df..15689137c 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -5425,8 +5425,21 @@ static int cmd_per_adv_create_sync_cancel(struct btdev *dev, const void *data, static int cmd_per_adv_term_sync(struct btdev *dev, const void *data, uint8_t len) { - /* TODO */ - return -ENOTSUP; + uint8_t status = BT_HCI_ERR_SUCCESS; + + /* If the periodic advertising train corresponding to the Sync_Handle + * parameter does not exist, then the Controller shall return the error + * code Unknown Advertising Identifier (0x42). + */ + if (dev->le_periodic_sync_handle != SYC_HANDLE) + status = BT_HCI_ERR_UNKNOWN_ADVERTISING_ID; + else + dev->le_periodic_sync_handle = 0x0000; + + cmd_complete(dev, BT_HCI_CMD_LE_PERIODIC_ADV_TERM_SYNC, + &status, sizeof(status)); + + return 0; } static int cmd_per_adv_add(struct btdev *dev, const void *data, uint8_t len) |