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: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
Diff: src/ConfigurationHandler/Controls/SetpointControl.cpp
- Revision:
- 20:653923c2f37a
- Parent:
- 19:9bc8fabeddfa
- Child:
- 28:c410a61238bb
--- a/src/ConfigurationHandler/Controls/SetpointControl.cpp Wed Sep 07 19:40:17 2016 +0000 +++ b/src/ConfigurationHandler/Controls/SetpointControl.cpp Thu Sep 08 15:01:52 2016 +0000 @@ -1,21 +1,36 @@ /****************************************************************************** * * File: SetpointControl.cpp - * Desciption: ICE Setpoint Control Class implementation + * Desciption: ICE Setpoint Control Class implementation * *****************************************************************************/ #include "SetpointControl.h" #include "mDot.h" +#include "MbedJSONValue.h" extern mDot *GLOBAL_mdot; -bool SetpointControl::Load(string _controlFile){ +bool SetpointControl::Load(string _controlFile) +{ controlFile = _controlFile; - + // try to open the control file mDot::mdot_file file = GLOBAL_mdot->openUserFile(controlFile.c_str(), mDot::FM_RDONLY); if ( file.fd < 0 ) return false; - + + // read the data into a buffer + unsigned char dataBuf[1024]; + + int bytes_read = GLOBAL_mdot->readUserFile(file, dataBuf, sizeof(dataBuf)); + if ( bytes_read ) { + printf("%s -> %s\n", __func__, dataBuf); + } else { + printf("%s: bytes_read = %d\n", __func__, bytes_read); + } + + // try to parse the file + //MbedJSONValue data; + return true; }