diff --git a/nx/include/switch/services/btm_types.h b/nx/include/switch/services/btm_types.h index 24eefa2f..7a249299 100644 --- a/nx/include/switch/services/btm_types.h +++ b/nx/include/switch/services/btm_types.h @@ -85,10 +85,21 @@ typedef struct { /// HostDeviceProperty typedef struct { - BtdrvAddress addr; ///< Same as BtdrvAdapterProperty::addr. - BtmClassOfDevice class_of_device; ///< Same as BtdrvAdapterProperty::class_of_device. - BtmBdName name; ///< Same as BtdrvAdapterProperty::name (except the last byte which is always zero). - u8 feature_set; ///< Same as BtdrvAdapterProperty::feature_set. + union { + struct { + BtdrvAddress addr; ///< Same as BtdrvAdapterProperty::addr. + BtmClassOfDevice class_of_device; ///< Same as BtdrvAdapterProperty::class_of_device. + BtmBdName name; ///< Same as BtdrvAdapterProperty::name (except the last byte which is always zero). + u8 feature_set; ///< Same as BtdrvAdapterProperty::feature_set. + } v1; ///< [1.0.0-12.1.0] + + struct { + BtdrvAddress addr; ///< Same as BtdrvAdapterProperty::addr. + BtmClassOfDevice class_of_device; ///< Same as BtdrvAdapterProperty::class_of_device. + char name[0xF9]; ///< Same as BtdrvAdapterProperty::name (except the last byte which is always zero). + u8 feature_set; ///< Same as BtdrvAdapterProperty::feature_set. + } v13; ///< [13.0.0+] + }; } BtmHostDeviceProperty; /// BtmConnectedDevice [1.0.0-12.1.0] diff --git a/nx/source/services/btm.c b/nx/source/services/btm.c index 525811f5..a1bd76d1 100644 --- a/nx/source/services/btm.c +++ b/nx/source/services/btm.c @@ -156,7 +156,10 @@ Result btmGetState(BtmState *out) { } Result btmGetHostDeviceProperty(BtmHostDeviceProperty *out) { - return serviceDispatchOut(&g_btmSrv, 1, *out); + if (hosversionBefore(13,0,0)) + return serviceDispatchOut(&g_btmSrv, 1, (*out).v1); + + return _btmCmdOutBufPtrFixed(out, sizeof((*out).v13), 1); } Result btmAcquireDeviceConditionEvent(Event* out_event) {