Separate library that holds helper functions for the main OMF code.
osisoft-omf.h@0:6156b29d3c91, 2018-01-22 (annotated)
- Committer:
- danielelopez
- Date:
- Mon Jan 22 17:11:34 2018 +0000
- Revision:
- 0:6156b29d3c91
- Child:
- 1:1c31b413ba0c
Refactored code into a separate OMF library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
danielelopez | 0:6156b29d3c91 | 1 | //Copyright 2017 OSIsoft, LLC |
danielelopez | 0:6156b29d3c91 | 2 | // |
danielelopez | 0:6156b29d3c91 | 3 | //Licensed under the Apache License, Version 2.0 (the "License"); |
danielelopez | 0:6156b29d3c91 | 4 | //you may not use this file except in compliance with the License. |
danielelopez | 0:6156b29d3c91 | 5 | //You may obtain a copy of the License at |
danielelopez | 0:6156b29d3c91 | 6 | // |
danielelopez | 0:6156b29d3c91 | 7 | //<http://www.apache.org/licenses/LICENSE-2.0> |
danielelopez | 0:6156b29d3c91 | 8 | // |
danielelopez | 0:6156b29d3c91 | 9 | //Unless required by applicable law or agreed to in writing, software |
danielelopez | 0:6156b29d3c91 | 10 | //distributed under the License is distributed on an "AS IS" BASIS, |
danielelopez | 0:6156b29d3c91 | 11 | //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
danielelopez | 0:6156b29d3c91 | 12 | //See the License for the specific language governing permissions and |
danielelopez | 0:6156b29d3c91 | 13 | //limitations under the License. |
danielelopez | 0:6156b29d3c91 | 14 | |
danielelopez | 0:6156b29d3c91 | 15 | #ifndef OSISOFT_OMF_H |
danielelopez | 0:6156b29d3c91 | 16 | #define OSISOFT_OMF_H |
danielelopez | 0:6156b29d3c91 | 17 | |
danielelopez | 0:6156b29d3c91 | 18 | #include "mbed.h" |
danielelopez | 0:6156b29d3c91 | 19 | #include "https_request.h" |
danielelopez | 0:6156b29d3c91 | 20 | |
danielelopez | 0:6156b29d3c91 | 21 | // ************************************************************************ |
danielelopez | 0:6156b29d3c91 | 22 | // Helper function that casts floats into strings |
danielelopez | 0:6156b29d3c91 | 23 | // ************************************************************************ |
danielelopez | 0:6156b29d3c91 | 24 | |
danielelopez | 0:6156b29d3c91 | 25 | string OMFLib_float_to_string(float f); |
danielelopez | 0:6156b29d3c91 | 26 | |
danielelopez | 0:6156b29d3c91 | 27 | // ************************************************************************ |
danielelopez | 0:6156b29d3c91 | 28 | // Helper function that sends an actual web request |
danielelopez | 0:6156b29d3c91 | 29 | // ************************************************************************ |
danielelopez | 0:6156b29d3c91 | 30 | |
danielelopez | 0:6156b29d3c91 | 31 | //void sendMessageToEndpoint(NetworkInterface* network, const char* action, const char* message_type, const char* body) { // Old: doesn't re-use sockets |
danielelopez | 0:6156b29d3c91 | 32 | void OMFLib_sendMessageToEndpoint(TLSSocket* socket, const char* action, const char* message_type, const char* body); |
danielelopez | 0:6156b29d3c91 | 33 | |
danielelopez | 0:6156b29d3c91 | 34 | // ************************************************************************ |
danielelopez | 0:6156b29d3c91 | 35 | // Gets the current time in the appropriate OMF format |
danielelopez | 0:6156b29d3c91 | 36 | // ************************************************************************ |
danielelopez | 0:6156b29d3c91 | 37 | |
danielelopez | 0:6156b29d3c91 | 38 | string OMFLib_getCurrentTimeString(); |
danielelopez | 0:6156b29d3c91 | 39 | |
danielelopez | 0:6156b29d3c91 | 40 | // ************************************************************************ |
danielelopez | 0:6156b29d3c91 | 41 | // Sets the clock via NTP via the nwtwork |
danielelopez | 0:6156b29d3c91 | 42 | // ************************************************************************ |
danielelopez | 0:6156b29d3c91 | 43 | |
danielelopez | 0:6156b29d3c91 | 44 | void OMFLib_syncClockViaNTP(NetworkInterface* network); |
danielelopez | 0:6156b29d3c91 | 45 | |
danielelopez | 0:6156b29d3c91 | 46 | #endif |