RTC programmed tasks

Hy guys,

Can someone help me with an ideea? … I need to make an application that needs to receive programmed tasks…
An user needs to enter an at command like in the following example:
at+taskadd = ,,,,,,task (task is a function to call - ex…gprs connection or something else)

How can i implement this? …i’m using the RTC service to store the date/time entered by the user. But how can i call a task at that time?..
The user can be able to enter something like this:
at+taskadd = 12,,,,14,,task… - * - means every month/year/minute etc. This task for example needs to execute every 12 day of every month at 2 pm.

I have no ideea…Can someone help with an ideea of what APIs i need to user?

Thanks in advance!

There is no API to get “alarm” signals - so you’d either have to implement it youself with a timer, or use AT+CALA

As for your “schedule” of tasks, you could use a list ordered by the required date+time for the task: one-off events are deleted when done; recurring events are re-inserted in the list…

Ok…i understand… that means i need to create the AT+CALA command…with at+cmdCreate command every time a user uses at+taskadd to insert a task…and to subscribe to the unsolicited response +CALA … and when i receive this response to call my function/task…i’m correct?

Only if you decide to go with the AT+CALA option, of course!

You could do that - subject to the AT+CALA limit of 16 events.

Alternatively, you could maintain your own list - and only use AT+CALA for the next event from your list.

I think you’re going to have to do some management of your own anyhow - as AT+CALA doesn’t seem to have any way to do recurring events…?

That’s the idea.

Yes…but as you said …there is no reccurency in at+cala…it accepts only one time alarm…i need reccurency…
I don’t know how to do it…it seems dificult to compute every parameter and compare if it is not * then comparing with the RTC and if it’s correct go to next parameter and so on…
Something like a “hierarhical IF”
if (!userday and userday==rtcday)
then verify month and so on…

It accepts up to 16.

No, it’s not difficult!

Maybe a bit laborious - but not difficult!

This part is just a standard programming exercise - it has nothing specifically to do with Open-AT.

Yes…i think is quite laborious…and i know that has nothing to do with Open AT…have any sugestion on how can i implement this easier with C ? i`m not very experienced in a large types of application…i can only think at a lot of if’s…maybe to contruct some arrays for easier comparison?..

Thanks a lot anyway for your concerning…

It is clearly a common problem for many types of application - anything that deals with appointments and scheduling events and suchlike…

If you’re a student, I suggest you get down to your library and look in the Computer Science section for books about algorithms…

Google terms like “scheduling”

Note that Google Labs has a search engine specifically for finding open-source software: codesearch.google.com

Thanks…i’m not a student …i’m a recently graduate and employed…and i work in a research and development for industrial space at a company…they want to implement some applications with open at modems specially for data aquisition…and it’s my responsibility…i started to work like a month ago with Open AT…and i learned a lot…made some applications for different purposes…but know i need to make a complex one…like a small firmware…with some configurations…and all that…a run mode part wich uses some configurations written in flash and all that…this witch scheduling is the most dificult part for now…and the last one that i need to implement before i finish the configuration part…

Thanks a lot for your advices…


As a recent graduate, you should be familiar with researching & looking up references - your supervisors/mentors should be able to help you find if there’s a suitable library nearby, or recommend books to buy.

As the old saying goes, “A good education is not so much about what you know, as about what you know how to find out…”