research application on sending data to headend
Dependencies: DataStore JobScheduler NetworkServices W5500Interface nanopb protocol
See "main.cpp" documentation on "API Documentation" tab for details about application.
Diff: source/main.h
- Revision:
- 26:1798e352679a
- Parent:
- 25:65e430b98cbe
--- a/source/main.h Fri Aug 04 21:27:44 2017 +0000 +++ b/source/main.h Fri Aug 04 21:40:24 2017 +0000 @@ -36,6 +36,20 @@ If scheduler stops, then main thread proceeds to the final stage of the application. At this stage it is guaranteed that no job will be running and no new job can be started, because scheduler has been stopped. Thus, environment is fully under the main() function control and drastic changes can be applied such as firmware upgrades. +@subsection do_job_lifetime Job Lifetime + +Job is a simple C function that executes as C module function or that acts as an adapter to C++ method. + +The simplest job is a function that does nothing. A slightly more complicated job can just print "Hello, world!". + +Job scheduler calls the function when it is time to execute it. Job scheduler guarantees that no other job can be running at the same time. Job scheduler takes care of make sure that job function is called again according to assigned schedule. + +Job scheduler does not guarantee that job will be started at exactly the requested time. If you want to make sure that job is started at the right time make sure you don't schedule more than one job for the same time or schedule 2 jobs too close to each other. Thus, the responsibility of ensuring that job starts at the right time sits at higher level with person how creates the overall schedule for all jobs. + +The next job run time is calculated by the scheduler after job function returns. + +In the future, when job takes Scheduler::Appointment data structure as an argument, the job will be able to dynamically modify its schedule. For example, the following scenario will be possible. Job is started with run once schedule. Run once schedule ensures that job runs only once. Prior to returning job can set new RunOnce schedule and thus have a variable business dependent timing with little added complexity. + @subsection do_parallel_to_jobs Running of Other Parallel Threads The job is just another C function and thus there is nothing to stop function from creating its own thread after execution ends. This is not denied, but a high level impact needs to be considered. @@ -53,4 +67,5 @@ @li http://www.emcu.eu/wp-content/uploads/2017/06/07-HandsOn-Part-3-Debugging-And-Tracing.pdf + */ \ No newline at end of file