mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
btm: update BtmDeviceInfo for 13.0.0
This commit is contained in:
parent
459a5c2125
commit
7c667c4dbf
@ -96,11 +96,11 @@ Result btmLegacyGetDeviceInfo(BtmDeviceInfoList *out);
|
|||||||
/**
|
/**
|
||||||
* @brief GetDeviceInfo [13.0.0+]
|
* @brief GetDeviceInfo [13.0.0+]
|
||||||
* @param[in] id Id
|
* @param[in] id Id
|
||||||
* @param[out] out \ref BtmDeviceInfo
|
* @param[out] out \ref BtmDeviceInfoV13
|
||||||
* @param[in] count Size of the out array in entries.
|
* @param[in] count Size of the out array in entries.
|
||||||
* @param[out] total_out Total output entries.
|
* @param[out] total_out Total output entries.
|
||||||
*/
|
*/
|
||||||
Result btmGetDeviceInfo(u32 id, BtmDeviceInfo *out, size_t count, s32 *total_out);
|
Result btmGetDeviceInfo(u32 id, BtmDeviceInfoV13 *out, size_t count, s32 *total_out);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief AddDeviceInfo
|
* @brief AddDeviceInfo
|
||||||
|
@ -190,7 +190,7 @@ typedef struct {
|
|||||||
BtmDeviceSlotMode devices[8]; ///< Array of \ref BtmDeviceSlotMode with the above count.
|
BtmDeviceSlotMode devices[8]; ///< Array of \ref BtmDeviceSlotMode with the above count.
|
||||||
} BtmDeviceSlotModeList;
|
} BtmDeviceSlotModeList;
|
||||||
|
|
||||||
/// DeviceInfo
|
/// DeviceInfo [1.0.0-12.1.0]
|
||||||
typedef struct {
|
typedef struct {
|
||||||
BtdrvAddress addr; ///< \ref BtdrvAddress
|
BtdrvAddress addr; ///< \ref BtdrvAddress
|
||||||
BtmClassOfDevice class_of_device; ///< ClassOfDevice
|
BtmClassOfDevice class_of_device; ///< ClassOfDevice
|
||||||
@ -203,13 +203,34 @@ typedef struct {
|
|||||||
BtmHidDeviceInfo hid_device_info; ///< \ref BtmHidDeviceInfo (Profile = Hid)
|
BtmHidDeviceInfo hid_device_info; ///< \ref BtmHidDeviceInfo (Profile = Hid)
|
||||||
} profile_info;
|
} profile_info;
|
||||||
u8 reserved2[0x1C]; ///< Reserved
|
u8 reserved2[0x1C]; ///< Reserved
|
||||||
|
} BtmDeviceInfoV1;
|
||||||
|
|
||||||
|
/// DeviceInfo [13.0.0+]
|
||||||
|
typedef struct {
|
||||||
|
BtdrvAddress addr; ///< \ref BtdrvAddress
|
||||||
|
BtmClassOfDevice class_of_device; ///< ClassOfDevice
|
||||||
|
BtmLinkKey link_key; ///< LinkKey
|
||||||
|
u8 reserved[3]; ///< Reserved
|
||||||
|
u32 profile; ///< \ref BtmProfile
|
||||||
|
union {
|
||||||
|
u8 data[0x4]; ///< Empty (Profile = None)
|
||||||
|
BtmHidDeviceInfo hid_device_info; ///< \ref BtmHidDeviceInfo (Profile = Hid)
|
||||||
|
} profile_info;
|
||||||
|
u8 reserved2[0x1C]; ///< Reserved
|
||||||
|
char name[0xFC]; ///< Name
|
||||||
|
} BtmDeviceInfoV13;
|
||||||
|
|
||||||
|
/// DeviceInfo [1.0.0-13.0.0]
|
||||||
|
typedef union {
|
||||||
|
BtmDeviceInfoV1 v1;
|
||||||
|
BtmDeviceInfoV13 v13;
|
||||||
} BtmDeviceInfo;
|
} BtmDeviceInfo;
|
||||||
|
|
||||||
/// DeviceInfoList
|
/// DeviceInfoList
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u8 device_count; ///< DeviceCount
|
u8 device_count; ///< DeviceCount
|
||||||
u8 reserved[3]; ///< Reserved
|
u8 reserved[3]; ///< Reserved
|
||||||
BtmDeviceInfo devices[10]; ///< Array of \ref BtmDeviceInfo with the above count.
|
BtmDeviceInfoV1 devices[10]; ///< Array of \ref BtmDeviceInfoV1 with the above count.
|
||||||
} BtmDeviceInfoList;
|
} BtmDeviceInfoList;
|
||||||
|
|
||||||
/// DeviceProperty
|
/// DeviceProperty
|
||||||
|
@ -215,11 +215,11 @@ Result btmLegacyGetDeviceInfo(BtmDeviceInfoList *out) {
|
|||||||
return _btmCmdOutBufPtrFixed(out, sizeof(*out), 9);
|
return _btmCmdOutBufPtrFixed(out, sizeof(*out), 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result btmGetDeviceInfo(u32 id, BtmDeviceInfo *out, size_t count, s32 *total_out) {
|
Result btmGetDeviceInfo(u32 id, BtmDeviceInfoV13 *out, size_t count, s32 *total_out) {
|
||||||
if (hosversionBefore(13,0,0))
|
if (hosversionBefore(13,0,0))
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
|
||||||
return _btmCmdInIdOutBufPtr(id, out, sizeof(BtmDeviceInfo)*count, total_out, 9);
|
return _btmCmdInIdOutBufPtr(id, out, sizeof(BtmDeviceInfoV13)*count, total_out, 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result btmAddDeviceInfo(const BtmDeviceInfo *info) {
|
Result btmAddDeviceInfo(const BtmDeviceInfo *info) {
|
||||||
|
Loading…
Reference in New Issue
Block a user