![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
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.cpp
- Revision:
- 4:b360d4f0bf34
- Parent:
- 2:661c545d718e
- Child:
- 7:c4123a87abe2
--- a/source/main.cpp Thu Jul 13 21:01:56 2017 +0000 +++ b/source/main.cpp Fri Jul 14 00:13:32 2017 +0000 @@ -6,8 +6,11 @@ #include "scheduler.h" #include "schedules.h" #include "jobService.h" +#include "netstack.h" +#include "lceProxy.h" + #include "jobTestPrint.h" -#include "netstack.h" +#include "jobFakeADC.h" // These are necessary only if thread safety is needed static Mutex TracingLock; @@ -39,11 +42,16 @@ exit(0); } + LceProxy lce(*nif); + JobScheduler::JobService js; JobScheduler::Scheduler scheduler(&js); JobTestPrint jtp; js.Register(1, JobTestPrint::RunAdapter, &jtp); + + JobFakeADC jfa(lce); + js.Register(2, JobFakeADC::RunAdapter, &jfa); scheduler.Start(); @@ -51,10 +59,13 @@ time_t nowSecs = time(NULL); JobScheduler::Response<JobScheduler::JobID> res = scheduler.JobAdd(1, new JobScheduler::RunOnceSchedule(nowSecs + 2), NULL); + res = scheduler.JobAdd(2, new JobScheduler::RunPeriodicSchedule(2, 5), NULL); // block forever unless there is a job that calls scheduler.Stop() scheduler.WaitToStop(); + /* we can somehow load new application image here and restart */ + // indicate clean app termination tr_info("**Finished**"); //-> "[INFO][main]: this is an info msg" exit(0);