mirror of
https://github.com/switchbrew/libnx.git
synced 2025-08-06 08:19:22 +02:00
notif: Use hidLaShowControllerFirmwareUpdate if needed.
This commit is contained in:
parent
baa9dab747
commit
527b813bcf
@ -44,7 +44,7 @@ typedef struct {
|
||||
/// Maximum alarms that can be registered at the same time by the host Application.
|
||||
#define NOTIF_MAX_ALARMS 8
|
||||
|
||||
/// Initialize notif. Only available on [9.0.0+]. Note that using Alarms also requires the [9.0.0+] firmware update for controllers to be installed.
|
||||
/// Initialize notif. Only available on [9.0.0+].
|
||||
Result notifInitialize(NotifServiceType service_type);
|
||||
|
||||
/// Exit notif.
|
||||
@ -116,6 +116,7 @@ Result notifAlarmSettingDisable(NotifAlarmSetting *alarm_setting, u32 day_of_wee
|
||||
/**
|
||||
* @brief Registers the specified AlarmSetting.
|
||||
* @note See \ref NOTIF_MAX_ALARMS for the maximum alarms.
|
||||
* @note When indicated by the output from \ref hidIsFirmwareUpdateNeededForNotification, this will use \ref hidLaShowControllerFirmwareUpdate.
|
||||
* @param[out] alarm_setting_id AlarmSettingId
|
||||
* @param[in] alarm_setting \ref NotifAlarmSetting
|
||||
* @param[in] buffer Input buffer containing the ApplicationParameter. Optional, can be NULL.
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include <string.h>
|
||||
#include "service_guard.h"
|
||||
#include "services/hid.h"
|
||||
#include "services/notif.h"
|
||||
#include "applets/hid_la.h"
|
||||
|
||||
#include "runtime/hosversion.h"
|
||||
|
||||
@ -108,6 +110,12 @@ Result notifAlarmSettingDisable(NotifAlarmSetting *alarm_setting, u32 day_of_wee
|
||||
}
|
||||
|
||||
Result notifRegisterAlarmSetting(u16 *alarm_setting_id, const NotifAlarmSetting *alarm_setting, const void* buffer, size_t size) {
|
||||
Result rc=0;
|
||||
bool flag=0;
|
||||
HidLaControllerFirmwareUpdateArg arg={.enable_force_update = 1};
|
||||
rc = hidIsFirmwareUpdateNeededForNotification(&flag);
|
||||
if (R_SUCCEEDED(rc) && flag) hidLaShowControllerFirmwareUpdate(&arg);
|
||||
|
||||
serviceAssumeDomain(&g_notifSrv);
|
||||
return serviceDispatchOut(&g_notifSrv, 500, *alarm_setting_id,
|
||||
.buffer_attrs = {
|
||||
|
Loading…
Reference in New Issue
Block a user