Commit 7cf2574c authored by fmg005's avatar fmg005

set_heartrate option added

parent 242459dc
......@@ -11,7 +11,7 @@ using namespace std;
int main() {
/*serial instance arguments*/
std::string port = "/dev/ttyACM0";
std::string port = "/dev/ttyUSB0";
uint32_t baudrate = 115200;
serial::Timeout timeout = serial::Timeout();
serial::bytesize_t bytesize = serial::eightbits;
......@@ -30,7 +30,7 @@ int main() {
size_t* int_sz;
cout << "Select number to switch states"<<endl;
cout << "1.Remote Mode\n2.Local Mode\n3.Set IBP\n4.Get Mode\n5.Quit\n\n";
cout << "1.Remote Mode\n2.Local Mode\n3.Set IBP\n4.Set HR\n5.GetMode\n6.Quit\n\n";
getline(cin, s_input);
input = stoi(s_input, int_sz);
......@@ -58,11 +58,23 @@ int main() {
simulator.SetIBP(1, sys, diast);
cout<<"\n";
}
}
else if(input == 4) {
double hr;
string s_hr;
size_t* sz;
cout<<"Enter the Heart Rate: ";
getline(cin, s_hr);
hr = stod(s_hr, sz);
simulator.SetHeartRate(hr);
cout<<"\n";
}
else if(input == 5) {
cout<<"Device is currently in "<<simulator.GetCurrentMode()<<" mode\n\n";
}
else if(input == 5) {
else if(input == 6) {
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment