Commit 64f93d58 authored by fmg005's avatar fmg005

changed monitor topic name

parent a85a5858
......@@ -4,7 +4,7 @@ HardwareSimulator::HardwareSimulator( std::shared_ptr<CLA::LOGGER>& logger,
serial::Serial* my_serial,CLA::Environment& env, std::map<std::string, CLA::Pump*>&
pumps) : m_serial(my_serial), m_logger(logger), m_env(env),
m_pumps(pumps), m_action(logger, pumps) {
m_monitor = new CLA::Monitor(logger, "/monitor", "std_msgs/String");
m_monitor = new CLA::Monitor(logger, "/dummy_monitor", "std_msgs/String");
}
void HardwareSimulator::update(std::unique_ptr<PhysiologyEngine>& engine) {
......
......@@ -41,6 +41,7 @@ namespace CLA {
socklen_t addrlen;
Document document; /* to parse json data */
Value m_patient_data;
Value _topic;
StringBuffer strbuf;
fd_set set; /* descriptor read set*/
std::shared_ptr<CLA::LOGGER> m_logger;
......
......@@ -74,11 +74,12 @@ void tcp_monitor_client::publish_patient_data(const string& p_data) {
void tcp_monitor_client::send_data_to_server(const string& p_data) {
/* rapidjson storing reference to string */
m_patient_data = StringRef(p_data.c_str(), strlen(p_data.c_str()));
_topic = StringRef(m_topic.c_str(), strlen(m_topic.c_str()));
document.SetObject();
Document::AllocatorType& allocator = document.GetAllocator();
Value object(kObjectType);
document.AddMember("op", "publish", allocator);
document.AddMember("topic", "/monitor", allocator);
document.AddMember("topic", _topic, allocator);
object.AddMember("data", m_patient_data, allocator);
document.AddMember("msg", object, allocator);
......
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