From 04ff5a2ef88221a81f745b9c56726306adfba63e Mon Sep 17 00:00:00 2001 From: Vasily Davydov Date: Thu, 13 Jan 2022 09:55:57 +0200 Subject: [PATCH] Create READme.md --- RSS_Management/READme.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 RSS_Management/READme.md diff --git a/RSS_Management/READme.md b/RSS_Management/READme.md new file mode 100644 index 0000000..9c6d5f6 --- /dev/null +++ b/RSS_Management/READme.md @@ -0,0 +1,39 @@ +### Communication: +Running the program on a computer will read the configuration file and check if it is valid. In case the Controller is connected to Computer, the Computer will send a `#` message to Controller, if the Controller is able to read the signal, it will respond to the Computer. Computer will create a new `LOG_FL` (if user doesn't have one already) with a configuration data and will document the activity until the program is stopped manually or just exitted the **readMode**. +#### The program will have the following menu: +| Choice | Functionality | +| ------ | ------ | +| Show LOG_FL | Show records | +| Go in Read mode | Logging the activity to the file every time the state changes. | +| Run device without reading | Running the device without reading | +| Erase LOG_FL | Deletes the LOG_FL | +| Exit | Exits the program | + + +> **Go in Read mode** Can't be entered without a configuration. If configuration file does not exit, program sets default values. The > first thing, it runs `initDATA()` and only then starts the `infiniteRead()`: +```cpp + while (future.wait_for(chrono::milliseconds(1)) == future_status::timeout) { + return_char = read(file_dest, &data_buff, 1); + if (return_char != 0) { + data_tof.push_back(data_buff); + if(data_buff == ';'){ + RSS_Parser pcr; + if (pcr.all_data(data_tof)){ + data_tof.erase(); + log << "State: {" << pcr.getState() + << "} Temp: {" << pcr.getTemp() << + "C°} Humid: {" << pcr.getHumid() << + "%} at: "<< pcr.getTime() < Mode can be ended with a press of 'q' character. The scanning is being run on a detached thread. + +[**RSS_Parser.cpp**](RSS_Management/src/RSS_Parser.cpp) class is made only for validating the data incoming from Microcontroller, since the incoming format is: +> `#[state]#[temp]#[humid];`. + +[**SP.cpp**](RSS_Management/src/SP.cpp) class is made out using the library `SerialPort` linked below and modified it to a class with own functionality. +