mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
hidsys: Fixed cmd order. Fixed output size for hidsysGetUniquePadSerialNumber.
This commit is contained in:
parent
26a0ee4af3
commit
0403c988ba
@ -108,6 +108,14 @@ Result hidsysEnableAppletToGetInput(bool enable);
|
|||||||
*/
|
*/
|
||||||
Result hidsysGetUniquePadIds(u64 *UniquePadIds, s32 count, s32 *total_entries);
|
Result hidsysGetUniquePadIds(u64 *UniquePadIds, s32 count, s32 *total_entries);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the unique pad's serial number.
|
||||||
|
* @note Only available on [5.0.0+].
|
||||||
|
* @param UniquePadId UniquePadId for the controller.
|
||||||
|
* @param serial Pointer to output the serial to. (The buffer size needs to be at least 0x11 bytes)
|
||||||
|
*/
|
||||||
|
Result hidsysGetUniquePadSerialNumber(u64 UniquePadId, char *serial);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets the HOME-button notification LED pattern, for the specified controller.
|
* @brief Sets the HOME-button notification LED pattern, for the specified controller.
|
||||||
* @note Generally this should only be used if \ref hidsysSetNotificationLedPatternWithTimeout is not usable.
|
* @note Generally this should only be used if \ref hidsysSetNotificationLedPatternWithTimeout is not usable.
|
||||||
@ -125,11 +133,3 @@ Result hidsysSetNotificationLedPattern(const HidsysNotificationLedPattern *patte
|
|||||||
* @param[in] timeout Timeout in nanoseconds.
|
* @param[in] timeout Timeout in nanoseconds.
|
||||||
*/
|
*/
|
||||||
Result hidsysSetNotificationLedPatternWithTimeout(const HidsysNotificationLedPattern *pattern, u64 UniquePadId, u64 timeout);
|
Result hidsysSetNotificationLedPatternWithTimeout(const HidsysNotificationLedPattern *pattern, u64 UniquePadId, u64 timeout);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Gets the unique pad's serial number.
|
|
||||||
* @note Only available on [5.0.0+].
|
|
||||||
* @param UniquePadId UniquePadId for the controller.
|
|
||||||
* @param serial Pointer to output the serial to. (The buffer size needs to be at least 0x19 bytes)
|
|
||||||
*/
|
|
||||||
Result hidsysGetUniquePadSerialNumber(u64 UniquePadId, char *serial);
|
|
||||||
|
@ -134,6 +134,17 @@ Result hidsysGetUniquePadIds(u64 *UniquePadIds, s32 count, s32 *total_entries) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result hidsysGetUniquePadSerialNumber(u64 UniquePadId, char *serial) {
|
||||||
|
if (hosversionBefore(5,0,0))
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
|
||||||
|
char out[0x10]={0};
|
||||||
|
if (serial) memset(serial, 0, 0x11);
|
||||||
|
Result rc = serviceDispatchInOut(&g_hidsysSrv, 809, UniquePadId, out);
|
||||||
|
if (R_SUCCEEDED(rc) && serial) memcpy(serial, out, 0x10);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
Result hidsysSetNotificationLedPattern(const HidsysNotificationLedPattern *pattern, u64 UniquePadId) {
|
Result hidsysSetNotificationLedPattern(const HidsysNotificationLedPattern *pattern, u64 UniquePadId) {
|
||||||
if (hosversionBefore(7,0,0))
|
if (hosversionBefore(7,0,0))
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
@ -158,14 +169,3 @@ Result hidsysSetNotificationLedPatternWithTimeout(const HidsysNotificationLedPat
|
|||||||
|
|
||||||
return serviceDispatchIn(&g_hidsysSrv, 831, in);
|
return serviceDispatchIn(&g_hidsysSrv, 831, in);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result hidsysGetUniquePadSerialNumber(u64 UniquePadId, char *serial) {
|
|
||||||
if (hosversionBefore(5,0,0))
|
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
|
||||||
|
|
||||||
char out[0x18]={0};
|
|
||||||
if (serial) memset(serial, 0, 0x19);
|
|
||||||
Result rc = serviceDispatchInOut(&g_hidsysSrv, 809, UniquePadId, out);
|
|
||||||
if (R_SUCCEEDED(rc) && serial) memcpy(serial, out, 0x18);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user