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:
- 193:3acbcc2f6fcb
- Parent:
- 190:af7ab603c9fe
- Parent:
- 192:052a419837fa
- Child:
- 194:5aa463e15d27
diff -r af7ab603c9fe -r 3acbcc2f6fcb src/ConfigurationHandler/Controls/SetpointControl.cpp --- a/src/ConfigurationHandler/Controls/SetpointControl.cpp Thu Oct 06 15:24:10 2016 +0000 +++ b/src/ConfigurationHandler/Controls/SetpointControl.cpp Thu Oct 06 15:37:37 2016 +0000 @@ -46,6 +46,22 @@ // parse the json data parse(json_value, dataBuf); + if ( !json_value.hasMember("id") || + !json_value.hasMember("priority") || + !json_value.hasMember("input") || + !json_value.hasMember("output") || + !json_value.hasMember("setpoint") || + !json_value.hasMember("prodfact") || + !json_value.hasMember("actingDir") || + !json_value.hasMember("halert") || + !json_value.hasMember("lalert") || + !json_value.hasMember("hfs") || + !json_value.hasMember("lfs") || + !json_value.hasMember("tol") ) { + logError("Setpoint Control file is missing expexted tags"); + return false; + } + id = json_value ["id"].get<string>(); priority = atoi(json_value["priority"].get<string>().c_str()); input = json_value ["input"].get<string>(); @@ -229,13 +245,13 @@ OutputControlMsg_t *output_mail = OutputMasterMailBox.alloc(); memset(output_mail, 0, sizeof(OutputControlMsg_t)); - + output_mail->action = ACTION_CONTROL_UNREGISTER; output_mail->controlType = CONTROL_MANUAL; output_mail->priority = this->priority; strncpy(output_mail->output_tag, this->output.c_str(), sizeof(output_mail->output_tag)-1); strncpy(output_mail->id, this->id.c_str(), sizeof(output_mail->id)-1); - + OutputMasterMailBox.put(output_mail); } @@ -259,7 +275,7 @@ ModbusValue inputValue; ModbusMasterReadRegister(input, &inputValue); - + printf("\r controlFile : %s \n", controlFile.c_str()); printf("\r id : %s \n", id.c_str()); printf("\r priority : %d \n", priority);