Myriota Flex SDK 2.5.0
Loading...
Searching...
No Matches
Time and Job Scheduling

Create and schedule jobs for the application. More...

Typedefs

typedef time_t(* FLEX_ScheduledJob) (void)
 

Functions

int FLEX_JobSchedule (const FLEX_ScheduledJob Job, const time_t Time)
 
time_t FLEX_ASAP (void)
 
time_t FLEX_Never (void)
 
time_t FLEX_SecondsFromNow (const unsigned Secs)
 
time_t FLEX_MinutesFromNow (const unsigned Mins)
 
time_t FLEX_HoursFromNow (const unsigned Hours)
 
time_t FLEX_DaysFromNow (const unsigned Days)
 

Detailed Description

Create and schedule jobs for the application.

Typedef Documentation

◆ FLEX_ScheduledJob

typedef time_t(* FLEX_ScheduledJob) (void)

Scheduled Job Function Pointer Declaration. The return value is the time at which the job should next run.

Function Documentation

◆ FLEX_JobSchedule()

int FLEX_JobSchedule ( const FLEX_ScheduledJob Job,
const time_t Time )

Reset the schedule for an existing job or add a new job.

Parameters
[in]Jobfunction pointer to the job to be scheduled.
[in]Timetime to run the job.
Returns
FLEX_SUCCESS (0) if succeeded and < 0 if failed.
Return values
-FLEX_ERROR_ENOMEMif the maximum number of jobs reached.

◆ FLEX_ASAP()

time_t FLEX_ASAP ( void )

Use this function to schedule a job to run immediately, by assigning the return value of this function to the time value at which the job should next run.

Returns
time at which the job will next run.

◆ FLEX_Never()

time_t FLEX_Never ( void )

Use this function to stop a job from being scheduled again, by assigning the return value of this function to the time value at which the job should next run.

Returns
time at which the job will next run.

◆ FLEX_SecondsFromNow()

time_t FLEX_SecondsFromNow ( const unsigned Secs)

Use this function to set the time value at which a job will run next. The job will run Secs after the current run.

Parameters
[in]Secsseconds after to run the job next.
Returns
time at which the job will next run.

◆ FLEX_MinutesFromNow()

time_t FLEX_MinutesFromNow ( const unsigned Mins)

Use this function to set the time value at which a job will run next. The job will run Mins after the current run.

Parameters
[in]Minsminutes after to run the job next.
Returns
time at which the job will next run.

◆ FLEX_HoursFromNow()

time_t FLEX_HoursFromNow ( const unsigned Hours)

Use this function to set the time value at which a job will run next. The job will run Hours after the current run.

Parameters
[in]Hourshours after to run the job next.
Returns
time at which the job will next run.

◆ FLEX_DaysFromNow()

time_t FLEX_DaysFromNow ( const unsigned Days)

Use this function to set the time value at which a job will run next. The job will run Days after the current run.

Parameters
[in]Daysdays after to run the job next.
Returns
time at which the job will next run.