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.

Revision:
16:bef1673b199e
Parent:
13:0fdbc14c33e7
Child:
17:b79ce8109995
--- a/source/main.cpp	Thu Aug 03 19:04:06 2017 +0000
+++ b/source/main.cpp	Thu Aug 03 20:57:50 2017 +0000
@@ -13,6 +13,7 @@
 #include "jobTestPrint.h"
 #include "jobFakeADC.h"
 #include "jobSchedulesUpload.h"
+#include "jobTestUpload.h"
 
  // These are necessary only if thread safety is needed
 static Mutex TracingLock;
@@ -73,8 +74,7 @@
         exit(0);
     }
     
-    const char* sn = "Nucleo1";
-    LceProxy lce(*nif, sn);
+    LceProxy lce(*nif, conf);
     
     JobScheduler::JobService js;   
     JobScheduler::Scheduler scheduler(&js);
@@ -98,22 +98,25 @@
     JobSchedulesUpload jSchedulesUpload(conf, lce, scheduler);
     js.Register(2, JobSchedulesUpload::RunAdapter, &jSchedulesUpload);
     
-    JobTestPrint jtp;
-    js.Register(1001, JobTestPrint::RunAdapter, &jtp);
+    JobTestPrint jTestPrint;
+    js.Register(1001, JobTestPrint::RunAdapter, &jTestPrint);
     
-    JobFakeADC jfa(lce);
-    js.Register(1002, JobFakeADC::RunAdapter, &jfa);
+    JobFakeADC jFakeADC(lce);
+    js.Register(1002, JobFakeADC::RunAdapter, &jFakeADC);
+    
+    JobTestUpload jTestUpload(lce);
+    js.Register(1003, JobTestUpload::RunAdapter, &jTestUpload);
 
     scheduler.Start();
     
     // inject test case
     time_t nowSecs = time(NULL);
     // NOTE: don't schedule run once with at 0, because 0 means never.
-    JobScheduler::Response<JobScheduler::JobID> res =
-          //scheduler.JobAdd(1002, new JobScheduler::RunPeriodicSchedule(3, 2), NULL);
-          scheduler.JobAdd(2, new JobScheduler::RunOnceSchedule(nowSecs+1), NULL);
-    res = 
-        scheduler.JobAdd(1001, new JobScheduler::RunOnceSchedule(nowSecs+5), NULL);
+    //JobScheduler::Response<JobScheduler::JobID> res =
+    //scheduler.JobAdd(2, new JobScheduler::RunOnceSchedule(nowSecs), NULL);
+    scheduler.JobAdd(1003, new JobScheduler::RunOnceSchedule(nowSecs+1), NULL);
+    scheduler.JobAdd(1001, new JobScheduler::RunOnceSchedule(nowSecs+5), NULL);
+    
         //scheduler.JobAdd(1002, new JobScheduler::RunOnceSchedule(1), NULL);
         //scheduler.JobAdd(1001, new JobScheduler::RunOnceSchedule(nowSecs + 2), NULL);
     //res = scheduler.JobAdd(1002, new JobScheduler::RunPeriodicSchedule(2, 5), NULL);