Separate library that holds helper functions for the main OMF code.
Diff: osisoft-omf.h
- Revision:
- 0:6156b29d3c91
- Child:
- 1:1c31b413ba0c
diff -r 000000000000 -r 6156b29d3c91 osisoft-omf.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/osisoft-omf.h Mon Jan 22 17:11:34 2018 +0000 @@ -0,0 +1,46 @@ +//Copyright 2017 OSIsoft, LLC +// +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//<http://www.apache.org/licenses/LICENSE-2.0> +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +#ifndef OSISOFT_OMF_H +#define OSISOFT_OMF_H + +#include "mbed.h" +#include "https_request.h" + +// ************************************************************************ +// Helper function that casts floats into strings +// ************************************************************************ + +string OMFLib_float_to_string(float f); + +// ************************************************************************ +// Helper function that sends an actual web request +// ************************************************************************ + +//void sendMessageToEndpoint(NetworkInterface* network, const char* action, const char* message_type, const char* body) { // Old: doesn't re-use sockets +void OMFLib_sendMessageToEndpoint(TLSSocket* socket, const char* action, const char* message_type, const char* body); + +// ************************************************************************ +// Gets the current time in the appropriate OMF format +// ************************************************************************ + +string OMFLib_getCurrentTimeString(); + +// ************************************************************************ +// Sets the clock via NTP via the nwtwork +// ************************************************************************ + +void OMFLib_syncClockViaNTP(NetworkInterface* network); + +#endif \ No newline at end of file