Digitalisierte Elektroverteilung zur permanenten Verbraucherüberwachung
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.cpp 998B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <iostream>
  2. #include <fstream>
  3. #include <unistd.h>
  4. #include <iomanip>
  5. #include <vector>
  6. #include <cstring>
  7. using namespace std;
  8. //0x4090793e
  9. int main()
  10. {
  11. std::vector<uint16_t> rawData;
  12. //Push some eample data
  13. double value = 7.5;
  14. //rawData.push_back(0x);
  15. //rawData.push_back(0x);
  16. //rawData.push_back(0x);
  17. //rawData.push_back(0x);
  18. std::memcpy(&value, rawData.data(), 4);
  19. std::cout << "Copied value = " << value;
  20. /*
  21. string line;
  22. const string cmd = "/home/michael/baConditionMonitoring/modpoll/x86_64-linux-gnu/modpoll -b 9600 -p none -m rtu -r 100 -1 -t 4:float /dev/pts/6 ";
  23. ifstream file ("data.txt");
  24. if (file.is_open())
  25. {
  26. while ( getline (file,line) )
  27. {
  28. sleep(1);
  29. string cmdValue = cmd + line;
  30. system(cmdValue.c_str());
  31. std::cout << "Written value " << line << endl;
  32. }
  33. file.close();
  34. }
  35. else
  36. cout << "opening failed..." << endl;
  37. */
  38. return 0;
  39. }