From aa02083a718583d96366476531c9c26981e45308 Mon Sep 17 00:00:00 2001 From: ndeadly <24677491+ndeadly@users.noreply.github.com> Date: Mon, 19 Oct 2026 20:44:52 +0200 Subject: [PATCH] btdrv: fix size of action field in scan filter event structure and add enum for scan filter actions --- nx/include/switch/services/btdrv.h | 3 ++- nx/include/switch/services/btdrv_types.h | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/nx/include/switch/services/btdrv.h b/nx/include/switch/services/btdrv.h index 32880599e..c35289fa9 100644 --- a/nx/include/switch/services/btdrv.h +++ b/nx/include/switch/services/btdrv.h @@ -392,7 +392,8 @@ typedef struct { struct { u32 result; ///< 0 for success, non-zero for error. - u32 action; ///< Scan filter action. 0 = Add, 1 = Delete, 2 = Clear, 3 = Enable, 4 = Disable + u8 action; ///< \ref BtdrvBleScanFilterAction + u8 pad[3]; ///< Padding } scan_filter; ///< ::BtdrvBleEventType_ScanFilter struct { diff --git a/nx/include/switch/services/btdrv_types.h b/nx/include/switch/services/btdrv_types.h index e16b99823..7a97f631d 100644 --- a/nx/include/switch/services/btdrv_types.h +++ b/nx/include/switch/services/btdrv_types.h @@ -141,6 +141,15 @@ typedef enum { BtdrvBleEventType_ServerAttributeOperation = 13, ///< GATT server attribute operation. } BtdrvBleEventType; +/// BleScanFilterAction +typedef enum { + BtdrvBleScanFilterAction_Add = 0, + BtdrvBleScanFilterAction_Delete = 1, + BtdrvBleScanFilterAction_Clear = 2, + BtdrvBleScanFilterAction_Enable = 3, + BtdrvBleScanFilterAction_Disable = 4, +} BtdrvBleScanFilterAction; + /// GattAttributeType typedef enum { BtdrvGattAttributeType_IncludedService = 0, ///< Included service