Changes

2,780 bytes added ,  23:59, 25 November 2019
Line 14: Line 14:  
| 3 || GetApplicationControlPropertyWithApplicationId || Takes an input u64 TitleId, returns a type-0x16 buffer filled with the contents of [[NACP_Format|control.nacp]]
 
| 3 || GetApplicationControlPropertyWithApplicationId || Takes an input u64 TitleId, returns a type-0x16 buffer filled with the contents of [[NACP_Format|control.nacp]]
 
|-
 
|-
| 9998 || [9.0.0+] ||
+
| 9998 || [9.0.0+] GetPreomiaApplicationLaunchProperty ||
 
|-
 
|-
| 9999 || [9.0.0+] ||
+
| 9999 || [9.0.0+] GetPreomiaApplicationControlProperty ||
 
|}
 
|}
   Line 396: Line 396:     
== RegisterAlarmSetting ==
 
== RegisterAlarmSetting ==
Takes a type-0x15 input buffer [[#AlarmSetting]] and a type-0x5 input buffer. Returns an u16 '''AlarmSettingId'''.
+
Takes a type-0x15 input buffer [[#AlarmSetting]] and a type-0x5 input buffer. Returns an [[#AlarmSettingId]].
 +
 
 +
The second buffer can be empty (addr=0/size=0). Size must be <=0x400. This is the ApplicationParameter.
 +
 
 +
A maximum of 8 Alarms can be registered by an Application at the same time.
 +
 
 +
Before using the cmd, sdknso uses [[HID_services|hid]] IsFirmwareUpdateNeededForNotification then if needed launches the controller-applet for firmware-update.
 +
 
 +
After using the cmd when it failed, [[Error_Applet|ShowError]] will be used when the Result is in a certain range, otherwise this will assert.
    
== UpdateAlarmSetting ==
 
== UpdateAlarmSetting ==
 
Takes a type-0x15 input buffer [[#AlarmSetting]] and a type-0x5 input buffer. No output.
 
Takes a type-0x15 input buffer [[#AlarmSetting]] and a type-0x5 input buffer. No output.
 +
 +
The second buffer can be empty (addr=0/size=0). Size must be <=0x400. This is the ApplicationParameter.
    
== ListAlarmSettings ==
 
== ListAlarmSettings ==
Line 405: Line 415:     
== LoadApplicationParameter ==
 
== LoadApplicationParameter ==
Takes an input u16 '''AlarmSettingId''' and a type-0x6 output buffer. Returns an u32.
+
Takes an input [[#AlarmSettingId]] and a type-0x6 output buffer containing the ApplicationParameter. Returns an u32 actual_size.
    
== DeleteAlarmSetting ==
 
== DeleteAlarmSetting ==
Takes an input u16 '''AlarmSettingId'''.
+
Takes an input [[#AlarmSettingId]].
    
== Initialize ==
 
== Initialize ==
Line 434: Line 444:  
| 1000 ||  
 
| 1000 ||  
 
|-
 
|-
| 1010 || GetNotification
+
| 1010 || [[#ListNotifications]]
 
|-
 
|-
| 1020 || DeleteNotification
+
| 1020 || [[#DeleteNotification]]
 
|-
 
|-
| 1030 ||  
+
| 1030 || [[#ClearNotifications]]
 
|-
 
|-
 
| 1040 ||  
 
| 1040 ||  
 
|-
 
|-
| 1500 || SetPresentationSetting
+
| 1500 || [[#SetPresentationSetting]]
 
|-
 
|-
| 1510 || GetPresentationSetting
+
| 1510 || [[#GetPresentationSetting]]
 
|-
 
|-
| 2000 ||  
+
| 2000 || [[#GetAlarmSetting]]
 
|-
 
|-
 
| 2001 ||
 
| 2001 ||
 
|-
 
|-
| 2010 || MuteAlarm
+
| 2010 || [[#MuteAlarmSetting]]
 
|-
 
|-
| 2020 || IsAlarmMuted
+
| 2020 || [[#IsAlarmSettingReady]]
 
|-
 
|-
 
| 8000 ||
 
| 8000 ||
Line 458: Line 468:  
| 8010 ||
 
| 8010 ||
 
|-
 
|-
| 9000 ||
+
| 9000 || [[#GetNextAlarm]]
 
|}
 
|}
    
== Cmd1000 ==
 
== Cmd1000 ==
 
No input, returns a total of 4-bytes of output.
 
No input, returns a total of 4-bytes of output.
 +
 +
== ListNotifications ==
 +
Unofficial name.
 +
 +
== DeleteNotification ==
 +
Unofficial name.
 +
 +
== ClearNotifications ==
 +
Unofficial name.
 +
 +
No input/output.
    
== Cmd1040 ==
 
== Cmd1040 ==
Line 478: Line 499:     
Cmd0: no input, returns an output handle.
 
Cmd0: no input, returns an output handle.
 +
 +
== SetPresentationSetting ==
 +
Unofficial name.
 +
 +
== GetPresentationSetting ==
 +
Unofficial name.
 +
 +
== GetAlarmSetting ==
 +
Unofficial name.
 +
 +
Takes an input [[#AlarmSettingId]]. Returns an [[#AlarmSetting]].
 +
 +
== MuteAlarmSetting ==
 +
Unofficial name.
 +
 +
Takes an input [[#AlarmSettingId]] and a bool.
 +
 +
== IsAlarmSettingReady ==
 +
Unofficial name.
 +
 +
Takes an input [[#AlarmSettingId]]. Returns a bool.
 +
 +
== GetNextAlarm ==
 +
Unofficial name.
 +
 +
Takes an input [[#AlarmSettingId]]. Returns an u8 '''IsAlarmScheduled''' and a [[Glue_services#PosixTime|PosixTime]] for the next scheduled alarm.
    
= ApplicationLaunchProperty =
 
= ApplicationLaunchProperty =
Line 508: Line 555:  
| Padding
 
| Padding
 
|}
 
|}
 +
 +
= AlarmSettingId =
 +
This is "nn::notification::AlarmSettingId". This is an u16.
    
= AlarmSetting =
 
= AlarmSetting =
Total size is 0x40 bytes.
+
This is "nn::notification::AlarmSetting". Total size is 0x40 bytes. When initializing this to the defaults, the entire struct is cleared then the last 0xE-bytes are set to 0xFF.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 520: Line 570:  
| 0x00
 
| 0x00
 
| 0x02
 
| 0x02
| Alarm ID
+
| [[#AlarmSettingId]]
 
|-
 
|-
 
| 0x02
 
| 0x02
Line 528: Line 578:  
| 0x03
 
| 0x03
 
| 0x01
 
| 0x01
| Muted
+
| u8 bool Muted (non-zero/true = AlarmSetting turned off, zero/false = on).
 +
|-
 +
| 0x04
 +
| 0x04
 +
| Padding
 
|-
 
|-
 
| 0x08
 
| 0x08
 +
| 0x10
 +
| UID. User account associated with this AlarmSetting. Used for the PreselectedUser when launching the Application when the system was previously in sleep-mode, instead of launching the applet for selecting the user.
 +
|-
 +
| 0x18
 
| 0x08
 
| 0x08
| UID high
+
| ApplicationId
 
|-
 
|-
| 0x10
+
| 0x20
 
| 0x08
 
| 0x08
| UID low
+
| Not set by sdksno, besides clearing it during initialization.
 
|-
 
|-
 +
| 0x28
 
| 0x18
 
| 0x18
| 0x08
+
| Alarm schedule (WeeklyScheduleAlarmSetting)
| Application ID
+
|}
 +
 
 +
Schedule:
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x28
+
! Offset
| 0x08
+
! Size
| Alarm schedule
+
! Description
 
|-
 
|-
| 0x30
+
| 0x00 || 0x0A || Not set by sdksno, besides clearing it during initialization.
| 0x08
  −
| Alarm schedule
   
|-
 
|-
| 0x38
+
| 0x0A || 0xE(7*2) || Array of 7 entries where each entry is 2-bytes. Index is <code>nn::time::DayOfWeek</code>, Sun-Sat.
| 0x08
  −
| Alarm schedule
   
|}
 
|}
 +
 +
Array entries:
 +
 +
Each byte is set using an input s32. An entry with value 0xFFFF (the default) indicates that it's disabled. The high byte is the hour, the low byte is the minute. This uses local-time.
 +
 +
sdknso checks whether an entry is enabled with: <code>return ({last 5-bits of the entry} < 3) && ((entry & 0xfc) < 60);</code>. The first check is equivalent to comparing the second entry byte with value 24.
    
[[Category:Services]]
 
[[Category:Services]]