Skip to content

tanneberger/lf-alarm-clock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lingua Franca Alarm Clock

Contact: [email protected]

A small and tiny alarmclock which is written using the scheduling and time features from lingua franca.

What you will learn

  • sharing state between reactors
  • stopping scheduled events

Project

Programm Structure

Building

Dependencies: jdk11, boost, mpg321

    $ lfc ./src/AlarmClock.lf

Building with nix

This cross compiles for aarch64.

    nix build .#packages.aarch64-linux.lf-alarm-clock

Endpoints & Usage

/list GET

Returns a list of upcoming events.

    "timestamp": {
        "date": str (human readable)
        "message": str
    }

/stop GET

Stops the currently playing alarm sound.

{
    "success": "exit code" // 0 means successfull
}

/add_event_timestamp POST

Will schedule your alarmclock for the given timestamp

Request:

{
    "message": str,
    "time_stamp": int
}

Response:

{
    "success": true
}

/add_event_relative POST

Will schedule a event relative to the current time.

Request

{
    "days": int(optional),
    "hours": int(optional),
    "minutes": int(optional),
    "seconds": int(optional)
}

Response:

{
    "success": true
}

/add_event_time POST

Schedule event for this time in the next 24 hours. If a parameter is unspecified the current time is used.

Request

{
    "hour": int(optional),
    "minute": int(optional),
    "second": int(optional)
}

Response:

{
    "success": true
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published