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:
- 2:661c545d718e
- Parent:
- 1:eebe442fc126
- Child:
- 4:b360d4f0bf34
--- a/source/main.cpp Thu Jul 13 20:01:25 2017 +0000 +++ b/source/main.cpp Thu Jul 13 20:59:59 2017 +0000 @@ -7,6 +7,7 @@ #include "schedules.h" #include "jobService.h" #include "jobTestPrint.h" +#include "netstack.h" // These are necessary only if thread safety is needed static Mutex TracingLock; @@ -22,13 +23,21 @@ int main() { printf("\n==Borsch==\n"); - + + uint8_t mac_addr[6] = {0x00, 0x08, 0xdc, 0x45, 0x56, 0x67}; + /* Setup tracing */ mbed_trace_mutex_wait_function_set( tracingWait ); // only if thread safety is needed 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" + + NetworkInterface* nif = initNetworkStack(mac_addr); + if (nif == NULL) { + tr_error("**Terminated**"); + exit(0); + } JobScheduler::JobService js; JobScheduler::Scheduler scheduler(&js);