diff --git a/nx/include/switch/services/btm.h b/nx/include/switch/services/btm.h index b3d351458..8db496e31 100644 --- a/nx/include/switch/services/btm.h +++ b/nx/include/switch/services/btm.h @@ -47,12 +47,12 @@ Result btmLegacyGetDeviceCondition(BtmDeviceCondition *out); /** * @brief GetDeviceCondition [13.0.0+] - * @param[in] id Id + * @param[in] profile \ref BtmProfile, when not ::BtmProfile_None entries are only returned which match this profile. * @param[out] out \ref BtmConnectedDeviceV13 * @param[in] count Size of the out array in entries. * @param[out] total_out Total output entries. */ -Result btmGetDeviceCondition(u32 id, BtmConnectedDeviceV13 *out, size_t count, s32 *total_out); +Result btmGetDeviceCondition(BtmProfile profile, BtmConnectedDeviceV13 *out, size_t count, s32 *total_out); /** * @brief SetBurstMode @@ -95,12 +95,12 @@ Result btmLegacyGetDeviceInfo(BtmDeviceInfoList *out); /** * @brief GetDeviceInfo [13.0.0+] - * @param[in] id Id + * @param[in] profile \ref BtmProfile, when not ::BtmProfile_None entries are only returned which match this profile. * @param[out] out \ref BtmDeviceInfoV13 * @param[in] count Size of the out array in entries. * @param[out] total_out Total output entries. */ -Result btmGetDeviceInfo(u32 id, BtmDeviceInfoV13 *out, size_t count, s32 *total_out); +Result btmGetDeviceInfo(BtmProfile profile, BtmDeviceInfoV13 *out, size_t count, s32 *total_out); /** * @brief AddDeviceInfo diff --git a/nx/include/switch/services/btm_types.h b/nx/include/switch/services/btm_types.h index 46209a6ce..078c7908f 100644 --- a/nx/include/switch/services/btm_types.h +++ b/nx/include/switch/services/btm_types.h @@ -118,10 +118,11 @@ typedef struct { typedef struct { BtdrvAddress address; u8 pad[2]; - u32 unk_x8; + u32 profile; ///< \ref BtmProfile u8 unk_xC[0x40]; char name[0x20]; - u8 unk_x6C[0xdc]; + u8 unk_x6C[0xD9]; + u8 pad2[3]; } BtmConnectedDeviceV13; /// DeviceCondition [1.0.0-5.0.2] @@ -217,7 +218,8 @@ typedef struct { BtmHidDeviceInfo hid_device_info; ///< \ref BtmHidDeviceInfo (Profile = Hid) } profile_info; u8 reserved2[0x1C]; ///< Reserved - char name[0xFC]; ///< Name + char name[0xF9]; ///< Name + u8 pad[3]; ///< Padding } BtmDeviceInfoV13; /// DeviceInfo [1.0.0-13.0.0] diff --git a/nx/source/services/btm.c b/nx/source/services/btm.c index 945cd5267..a0e2089b2 100644 --- a/nx/source/services/btm.c +++ b/nx/source/services/btm.c @@ -178,11 +178,11 @@ Result btmLegacyGetDeviceCondition(BtmDeviceCondition *out) { return _btmCmdOutBufPtrFixed(out, buff_size, 3); } -Result btmGetDeviceCondition(u32 id, BtmConnectedDeviceV13 *out, size_t count, s32 *total_out) { +Result btmGetDeviceCondition(BtmProfile profile, BtmConnectedDeviceV13 *out, size_t count, s32 *total_out) { if (hosversionBefore(13,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); - return _btmCmdInIdOutBufPtr(id, out, sizeof(BtmConnectedDeviceV13)*count, total_out, 3); + return _btmCmdInIdOutBufPtr(profile, out, sizeof(BtmConnectedDeviceV13)*count, total_out, 3); } Result btmSetBurstMode(BtdrvAddress addr, bool flag) { @@ -215,11 +215,11 @@ Result btmLegacyGetDeviceInfo(BtmDeviceInfoList *out) { return _btmCmdOutBufPtrFixed(out, sizeof(*out), 9); } -Result btmGetDeviceInfo(u32 id, BtmDeviceInfoV13 *out, size_t count, s32 *total_out) { +Result btmGetDeviceInfo(BtmProfile profile, BtmDeviceInfoV13 *out, size_t count, s32 *total_out) { if (hosversionBefore(13,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); - return _btmCmdInIdOutBufPtr(id, out, sizeof(BtmDeviceInfoV13)*count, total_out, 9); + return _btmCmdInIdOutBufPtr(profile, out, sizeof(BtmDeviceInfoV13)*count, total_out, 9); } Result btmAddDeviceInfo(const BtmDeviceInfo *info) {