Skip to content

Suggestion: getAlarmEpoch() #67

Open
@sergerold

Description

@sergerold

Hi

I noticed that there is no 'getAlarmEpoch()' method. I have implemented in my own sketch but it may be worthwhile adding to the library.

uint32_t getAlarmEpoch()
        {
            struct tm alarmTime;
            
            alarmTime.tm_isdst = -1;
            alarmTime.tm_yday = 0;
            alarmTime.tm_wday = 0;
            alarmTime.tm_year = pRtcAlarm->getAlarmYear() + EPOCH_TIME_YEAR_OFF;
            alarmTime.tm_mon = pRtcAlarm->getAlarmMonth() - 1;
            alarmTime.tm_mday = pRtcAlarm->getAlarmDay();
            alarmTime.tm_hour = pRtcAlarm->getAlarmHours();
            alarmTime.tm_min = pRtcAlarm->getAlarmMinutes();
            alarmTime.tm_sec = pRtcAlarm->getAlarmSeconds();
            
            return mktime(&alarmTime);
}

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions