ADD: added message callback to udp listener

This commit is contained in:
Henry Winkel
2023-08-16 15:01:23 +02:00
parent aa7418ebc9
commit f794f4c5d0
7 changed files with 42 additions and 19 deletions

View File

@@ -44,13 +44,13 @@ int main()
// WHISPER::Join join(1,1,WHISPER::SourceType::SHIP,8000,"192.168.1.178");
auto receiver = std::make_shared<WHISPER::threadSafeQueue<WHISPER::Message>>();
WHISPER::InternalUDPService service(0,1,WHISPER::SHIP,8000,"192.168.1.255","192.168.1.178");
WHISPER::InternalUDPService service("01",8000,"192.168.1.255","192.168.1.178");
service.connect(receiver);
service.subscribe(WHISPER::MsgTopicsMap[WHISPER::MsgTopics::DATA]);
// service.subscribe(WHISPER::MsgTopicsMap[WHISPER::MsgTopics::TRACK]);
WHISPER::StringData data(0,1,WHISPER::SHIP,"hello world");
WHISPER::StringData data("01","hello world");
service.publish(data.serialize(), WHISPER::MsgTopicsMap[WHISPER::MsgTopics::DATA]);