ADD: added new basic messages and added the parentID as an part of the identifier

This commit is contained in:
Henry Winkel
2023-01-19 16:03:58 +01:00
parent 49bdb28535
commit 73b15d235a
32 changed files with 2140 additions and 140 deletions

View File

@@ -1,4 +1,5 @@
#include "WHISPER/Messages/Message.hpp"
#include "WHISPER/Messages/stringData.hpp"
#include "zmq.hpp"
#include <iostream>
#include <loguru.hpp>
@@ -47,7 +48,7 @@ int main()
auto receiver = std::make_shared<WHISPER::threadSafeQueue<WHISPER::Message>>();
WHISPER::InternalUDPService service(2,WHISPER::SHIP,8000,"192.168.0.255","192.168.1.178");
WHISPER::InternalUDPService service(0,2,WHISPER::SHIP,8000,"127.0.0.255","127.0.0.1");
service.subscribe(WHISPER::MsgTopicsMap[WHISPER::MsgTopics::TRACK]);
service.subscribe(WHISPER::MsgTopicsMap[WHISPER::MsgTopics::DATA]);
@@ -67,14 +68,15 @@ int main()
while (running) {
if (msgcount != receiver->size()) {
LOG_S(INFO)<<"received messages " << receiver->size();
auto received = receiver.get()->get();
auto topic = received.topic_;
LOG_S(INFO)<<"message type is: "<<received.msgType_;
if (received.msgType_ == WHISPER::RAW_TRACK) {
WHISPER::Message msg;
auto received = receiver.get()->get(msg);
if (received == true) {
if (msg.msgType_ == WHISPER::MsgType::STRINGDATA) {
WHISPER::StringData data(msg.serialize());
LOG_S(INFO)<<data.data_;
}
}
msgcount = receiver->size();
// service.publish(received.serialize(), WHISPER::MsgTopicsMap[(WHISPER::MsgTopics)topic]);