Skip to content
Snippets Groups Projects
Unverified Commit a047f3f3 authored by Grigoris Pavlakis's avatar Grigoris Pavlakis
Browse files

Add getters for PTC and PFC sub-fields

parent a2bc3640
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,7 @@ class Parameter {
ValueType getCurrentValue();
uint8_t getPTC();
uint8_t getPFC();
};
......
......@@ -24,4 +24,13 @@ void Parameter::setCurrentValue(ValueType newVal) {
ValueType Parameter::getCurrentValue() {
return currentValue;
}
\ No newline at end of file
}
uint8_t Parameter::getPTC() {
return ptc;
}
uint8_t Parameter::getPFC() {
return pfc;
}
#include "Services/ParameterService.hpp"
#include "Services/Parameter.hpp"
ParameterService::ParameterService() {
ParameterService::ParameterService() {
// test addings
addNewParameter(3, 14);
addNewParameter(3, 14);
// // Test code, setting up some of the parameter fields
//
// time_t currTime = time(nullptr);
// struct tm* today = localtime(&currTime);
//
// Parameter test1, test2;
//
// test1.currentValue = today->tm_hour; // the current hour
// test1.ptc = 3; // unsigned int
// test1.pfc = 14; // 32 bits
//
// test2.currentValue = today->tm_min; // the current minute
// test2.ptc = 3; // unsigned int
// test2.pfc = 14; // 32 bits
//
// // MAKE SURE THE IDS ARE UNIQUE WHEN INSERTING!
// /**
// * @todo: Make a separate insert() function for parameter insertion to protect from blunders
// * if needed to
// */
//
// paramsList.insert(std::make_pair(0, test1));
// paramsList.insert(std::make_pair(1, test2));
//
//#endif
}
bool ParameterService::addNewParameter(uint8_t ptc, uint8_t pfc, uint32_t initialValue, UpdatePtr ptr) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment