7#ifndef __PIPBUSBACKEND_H__
8#define __PIPBUSBACKEND_H__
10#include "PSocketFlag.h"
11#include "phoenix_generic_mock.h"
12#include "phoenix_data_stream.h"
42 PSendStatus::PSendStatus
sendData(
const T & data, PSendFlag::PSendFlag flag = PSendFlag::BLOCK);
43 PSendStatus::PSendStatus
sendMsg(
Message & msg, PSendFlag::PSendFlag flag = PSendFlag::BLOCK);
46 PRecvStatus::PRecvStatus
recvData(T & data, PRecvFlag::PRecvFlag flag = PRecvFlag::BLOCK);
47 PRecvStatus::PRecvStatus
recvMsg(
Message & msg, PRecvFlag::PRecvFlag flag = PRecvFlag::BLOCK);
69 static Param client(std::string &connectionFilePath, std::string &connectionId);
70 static Param server(std::string &connectionFilePath, std::string &connectionId);
std::string statusToStr(T status)
Convert PSendStatus into string.
PIpBusSocket Socket
Define the socket of the backend used by the PAbstractSocketManager.
PIpBusBackend()
Default constructor of PIpBusBackend.
bool createServerSocket(Socket &socket, const PSocketParam &socketParam, const Param ¶m)
Create parameters for a server socket.
static void msgToMock(DataStreamMsg &mockMsg, const Message &msg)
Copy current backend message data into mock message.
static void mockToMsg(Message &msg, DataStreamMsg &mockMsg)
Copy mock message data into current backend message.
PIpBusParam Param
Define the type of extra parameters which can be used to create a Socket.
static Param client(std::string &connectionFilePath, std::string &connectionId)
Create parameters for a client socket.
bool createClientSocket(Socket &socket, const PSocketParam &socketParam, const Param ¶m)
Create parameters for a client socket.
static Param server(std::string &connectionFilePath, std::string &connectionId)
Create parameters for a server socket.
UaMessage Message
Define the type of message used by the PAbstractSocketManager.
PhoenixSocket API bridge to IpBus backend.
PIpBusSocket()
Default constructor of PIpBusSocket.
virtual ~PIpBusSocket()
Destructor of PIpBusSocket.
PIpBusParam Param
Define the type of extra parameters which can be used to create a Socket.
bool createServerSocket(const Param &extraParam)
Create a server socket.
bool createClientSocket(const Param &extraParam)
Create a client socket.
void close()
Close the socket.
IpBusImpl * p_uaSocket
UA socket.
PSendStatus::PSendStatus sendMsg(Message &msg, PSendFlag::PSendFlag flag=PSendFlag::BLOCK)
PSendStatus::PSendStatus sendData(const T &data, PSendFlag::PSendFlag flag=PSendFlag::BLOCK)
Send data with the socket.
PRecvStatus::PRecvStatus recvData(T &data, PRecvFlag::PRecvFlag flag=PRecvFlag::BLOCK)
Recieved data with the socket.
PRecvStatus::PRecvStatus recvMsg(Message &msg, PRecvFlag::PRecvFlag flag=PRecvFlag::BLOCK)
Receive a message from the given socket.
UaMessage Message
Define the type of message used by the PAbstractSocketManager.
Set of parameters to be passed as message.
Set of parameters to be passed to create a socket with mock backend.
std::string connectionFilePath
Connection File Path.
std::string connectionId
Device Id.