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:
13:0fdbc14c33e7
Parent:
12:ec140a26367f
Child:
16:bef1673b199e
diff -r ec140a26367f -r 0fdbc14c33e7 source/main.cpp
--- a/source/main.cpp	Wed Aug 02 14:48:16 2017 +0000
+++ b/source/main.cpp	Thu Aug 03 00:07:50 2017 +0000
@@ -7,6 +7,7 @@
 #include "schedules.h"
 #include "jobService.h"
 #include "netstack.h"
+#include "config.h"
 #include "lceProxy.h"
 
 #include "jobTestPrint.h"
@@ -61,7 +62,9 @@
     mbed_trace_mutex_release_function_set( tracingRelease ); // only if thread safety is needed
     mbed_trace_init();       // initialize the trace library
     
-    tr_info("**Started**");    //-> "[INFO][main]: this is an info msg"    
+    tr_info("**Started**");    //-> "[INFO][main]: this is an info msg"
+    
+    Config conf("Nucleo1");
 
     uint8_t mac_addr[6] = {0x00, 0x08, 0xdc, 0x45, 0x56, 0x67};
     NetworkInterface* nif = initNetworkStack(mac_addr);
@@ -92,7 +95,7 @@
     */
 
     // command #2 is List Schedules in ISOM.
-    JobSchedulesUpload jSchedulesUpload(lce, scheduler);
+    JobSchedulesUpload jSchedulesUpload(conf, lce, scheduler);
     js.Register(2, JobSchedulesUpload::RunAdapter, &jSchedulesUpload);
     
     JobTestPrint jtp;
@@ -107,8 +110,10 @@
     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, 5), NULL);
-    res = scheduler.JobAdd(2, new JobScheduler::RunOnceSchedule(2), NULL);
+          //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);
         //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);