Skip to content

Commit

Permalink
btm: Updated structs/params for 13.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
yellows8 committed Sep 25, 2021
1 parent b571429 commit c6dcbdf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions nx/include/switch/services/btm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions nx/include/switch/services/btm_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down
8 changes: 4 additions & 4 deletions nx/source/services/btm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c6dcbdf

Please sign in to comment.