Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DataStore JobScheduler NetworkServices W5500Interface nanopb protocol
source/jobSchedulesUpload.cpp@11:acaefb63fc6b, 2017-08-02 (annotated)
- Committer:
- sgnezdov
- Date:
- Wed Aug 02 00:22:06 2017 +0000
- Revision:
- 11:acaefb63fc6b
- Child:
- 13:0fdbc14c33e7
started work on uploading current schedule to headend
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sgnezdov | 11:acaefb63fc6b | 1 | #include "jobSchedulesUpload.h" |
sgnezdov | 11:acaefb63fc6b | 2 | |
sgnezdov | 11:acaefb63fc6b | 3 | #include "mbed-trace/mbed_trace.h" |
sgnezdov | 11:acaefb63fc6b | 4 | #define TRACE_GROUP "scup" |
sgnezdov | 11:acaefb63fc6b | 5 | |
sgnezdov | 11:acaefb63fc6b | 6 | void JobSchedulesUpload::Run() { |
sgnezdov | 11:acaefb63fc6b | 7 | tr_info("Job Schedules Upload"); |
sgnezdov | 11:acaefb63fc6b | 8 | // time_t now = time(NULL); |
sgnezdov | 11:acaefb63fc6b | 9 | //tr_debug("ADC created time is: %s\n", ctime(&now)); |
sgnezdov | 11:acaefb63fc6b | 10 | // struct AdcMsg msg; |
sgnezdov | 11:acaefb63fc6b | 11 | // convert seconds to nanoseconds |
sgnezdov | 11:acaefb63fc6b | 12 | // msg.Created = now * 1e9; |
sgnezdov | 11:acaefb63fc6b | 13 | // tr_debug("Current time: %x sec, %llx nanosecs", now, msg.Created); |
sgnezdov | 11:acaefb63fc6b | 14 | // // swapt for byte order |
sgnezdov | 11:acaefb63fc6b | 15 | // msg.Created = swap_uint64(msg.Created); // swap_uint64(msg.Created); |
sgnezdov | 11:acaefb63fc6b | 16 | // msg.Mask = 0x80; // 0x80 bits: 1000 0000 |
sgnezdov | 11:acaefb63fc6b | 17 | // for (int i = 0; i < 8; i++) { |
sgnezdov | 11:acaefb63fc6b | 18 | // msg.Chs[i].Raw = 0; |
sgnezdov | 11:acaefb63fc6b | 19 | // msg.Chs[i].V = 0; |
sgnezdov | 11:acaefb63fc6b | 20 | // } |
sgnezdov | 11:acaefb63fc6b | 21 | // msg.Chs[0].Raw = swap_uint32(_next++); |
sgnezdov | 11:acaefb63fc6b | 22 | // msg.Chs[0].V = msg.Chs[0].Raw; |
sgnezdov | 11:acaefb63fc6b | 23 | // /test can be used to send to test endpoint that responds with |
sgnezdov | 11:acaefb63fc6b | 24 | // a short hardcoded string |
sgnezdov | 11:acaefb63fc6b | 25 | // /uw/adc - to send adc version 1 |
sgnezdov | 11:acaefb63fc6b | 26 | // _lce.SendV1("/uw/adc", (uint8_t*)&msg, sizeof(msg), false, now); |
sgnezdov | 11:acaefb63fc6b | 27 | } |
sgnezdov | 11:acaefb63fc6b | 28 | |
sgnezdov | 11:acaefb63fc6b | 29 | |
sgnezdov | 11:acaefb63fc6b | 30 |