Skip to content

Commit

Permalink
add receiver function
Browse files Browse the repository at this point in the history
  • Loading branch information
huebl committed Jan 22, 2023
1 parent 73700ef commit db57b08
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
19 changes: 18 additions & 1 deletion src/OpcUaStackPubSub/MessageTransport/MsgTransPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
Autor: Kai Huebl (kai@huebl-sgh.de)
*/

#include "OpcUaStackCore/Base/Log.h"
#include "OpcUaStackPubSub/Events/NetworkSendEvent.h"
#include "OpcUaStackPubSub/MessageTransport/MsgTransPublisher.h"

using namespace OpcUaStackCore;
Expand Down Expand Up @@ -49,7 +51,22 @@ namespace OpcUaStackPubSub
[this](const MessageBusMember::WPtr& handleFrom, Message::SPtr& message) {
// receive message from internal message bus

// FIXME: todo
auto event = boost::static_pointer_cast<Event>(message);
switch (event->eventType())
{
case EventType::NetworkSendEvent:
{
NetworkSendEvent::SPtr event = boost::static_pointer_cast<NetworkSendEvent>(message);
// FIXME: todo
break;
}
default:
{
Log(Error, "invalid message received in message transport module")
.parameter("ServiceName", serviceName_)
.parameter("Event", (uint32_t)event->eventType());
}
}
}
);
}
Expand Down
18 changes: 17 additions & 1 deletion src/OpcUaStackPubSub/MessageTransport/MsgTransSubscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Autor: Kai Huebl (kai@huebl-sgh.de)
*/
#include "OpcUaStackCore/Base/Log.h"
#include "OpcUaStackPubSub/Events/NetworkRecvEvent.h"
#include "OpcUaStackPubSub/MessageTransport/MsgTransSubscriber.h"

using namespace OpcUaStackCore;
Expand Down Expand Up @@ -48,7 +49,22 @@ namespace OpcUaStackPubSub
[this](const MessageBusMember::WPtr& handleFrom, Message::SPtr& message) {
// receive message from internal message bus

// FIXME: todo
auto event = boost::static_pointer_cast<Event>(message);
switch (event->eventType())
{
case EventType::NetworkRecvEvent:
{
NetworkRecvEvent::SPtr event = boost::static_pointer_cast<NetworkRecvEvent>(message);
// FIXME: todo
break;
}
default:
{
Log(Error, "invalid message received in message transport module")
.parameter("ServiceName", serviceName_)
.parameter("Event", (uint32_t)event->eventType());
}
}
}
);
}
Expand Down

0 comments on commit db57b08

Please sign in to comment.