mirror of
https://github.com/joel16/SwitchIdent.git
synced 2024-11-23 03:39:40 +00:00
Display device ID using spl
This commit is contained in:
parent
f2ba108e1c
commit
72be1ff56e
@ -5,6 +5,7 @@ const char *SwitchIdent_GetVersion(void);
|
||||
const char *SwitchIdent_GetHardwareType(void);
|
||||
const char *SwitchIdent_GetUnit(void);
|
||||
bool SwitchIdent_IsSafeMode(void);
|
||||
u64 SwitchIdent_GetDeviceID(void);
|
||||
const char *SwitchIdent_GetSerialNumber(void);
|
||||
|
||||
#endif
|
||||
|
@ -118,6 +118,17 @@ bool SwitchIdent_IsSafeMode(void)
|
||||
return out;
|
||||
}
|
||||
|
||||
u64 SwitchIdent_GetDeviceID(void)
|
||||
{
|
||||
Result ret = 0;
|
||||
u64 deviceID = 0;
|
||||
|
||||
if (R_FAILED(ret = splGetConfig(SplConfigItem_DeviceId, &deviceID)))
|
||||
printf("splGetConfig(SplConfigItem_DeviceId) failed: 0x%x.\n\n", ret);
|
||||
|
||||
return deviceID;
|
||||
}
|
||||
|
||||
const char *SwitchIdent_GetSerialNumber(void)
|
||||
{
|
||||
Result ret = 0;
|
||||
|
@ -58,7 +58,8 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
printf("\x1b[31;1m*\x1b[0m System version: \x1b[31;1m%s\n", SwitchIdent_GetVersion());
|
||||
printf("\x1b[31;1m*\x1b[0m Hardware: \x1b[31;1m%s\x1b[0m (\x1b[31;1m%s\x1b[0m) \x1b[0m\n", SwitchIdent_GetHardwareType(), SwitchIdent_GetUnit());
|
||||
printf("\x1b[31;1m*\x1b[0m Serial number: \x1b[31;1m%s\n\n", SwitchIdent_GetSerialNumber());
|
||||
printf("\x1b[31;1m*\x1b[0m Serial number: \x1b[31;1m%s\n", SwitchIdent_GetSerialNumber());
|
||||
printf("\x1b[31;1m*\x1b[0m Device ID: \x1b[31;1m%llu\n\n", SwitchIdent_GetDeviceID());
|
||||
|
||||
/*
|
||||
System info:
|
||||
|
Loading…
Reference in New Issue
Block a user