17 #ifndef SCIP2_RESPONSE_TIME_SYNC_H
18 #define SCIP2_RESPONSE_TIME_SYNC_H
20 #include <boost/asio.hpp>
45 using Callback = boost::function<void(
46 const boost::posix_time::ptime&,
57 return std::string(
"TM");
60 const boost::posix_time::ptime& time_read,
61 const std::string& echo_back,
62 const std::string& status,
70 cb_(time_read, echo_back, status, timestamp);
75 if (echo_back[2] ==
'1')
78 if (!std::getline(stream, stamp))
84 const uint8_t
checksum = stamp.back();
94 auto it = dec.begin();
96 if ((dec.getChecksum() & 0x3F) + 0x30 !=
checksum)
105 cb_(time_read, echo_back, status, timestamp);
117 #endif // SCIP2_RESPONSE_TIME_SYNC_H