*/
#include <stddef.h>
#include <dpl/rpc/generic_rpc_connection.h>
-#include <dpl/scoped_array.h>
-#include <dpl/log/log.h>
+#include <dpl/log/wrt_log.h>
#include <dpl/aligned.h>
#include <stdexcept>
AbstractWaitableInputOutput *inputOutput) :
m_inputOutput(inputOutput)
{
- LogPedantic("Opening generic RPC...");
+ WrtLogD("Opening generic RPC...");
WaitableInputOutputExecutionContextSupport::Open(inputOutput);
- LogPedantic("Generic RPC opened");
+ WrtLogD("Generic RPC opened");
}
GenericRPCConnection::~GenericRPCConnection()
{
// Ensure RPC is closed
- LogPedantic("Closing generic RPC...");
+ WrtLogD("Closing generic RPC...");
WaitableInputOutputExecutionContextSupport::Close();
- LogPedantic("Generic RPC closed");
+ WrtLogD("Generic RPC closed");
}
void GenericRPCConnection::AsyncCall(const RPCFunction &function)
{
- LogPedantic("Executing async call");
+ WrtLogD("Executing async call");
// Create binary call
BinaryQueue serializedCall = function.Serialize();
void GenericRPCConnection::Ping()
{
- LogPedantic("Executing ping call");
+ WrtLogD("Executing ping call");
// Append buffers
Protocol::AsyncCall call;
void GenericRPCConnection::OnInputStreamRead()
{
- LogPedantic("Interpreting " << m_inputStream.Size() << " bytes buffer");
+ WrtLogD("Interpreting %i bytes buffer", m_inputStream.Size());
// Enough bytes to read at least one header ?
if (m_inputStream.Size() >= sizeof(Protocol::Header)) {
if (m_inputStream.Size() >= sizeof(Protocol::Header) +
header.size)
{
- LogPedantic("Will parse packet of type: " << header.type);
+ WrtLogD("Will parse packet of type: %i", header.type);
// Allocate new packet (header + real packet data)
void *binaryPacket = malloc(
// ...but just remove protocol header
call.Consume(sizeof(Protocol::Header));
- LogPedantic(
- "Async call of size: " << header.size <<
- " parsed");
+ WrtLogD("Async call of size: %i parsed", header.size);
// Call async call event listeners
DPL::Event::EventSupport<AbstractRPCConnectionEvents::
// Do not need packet data
free(binaryPacket);
- LogPedantic("Ping pong replied");
+ WrtLogD("Ping pong replied");
}
break;
default:
- LogPedantic("Warning: Unknown packet type");
+ WrtLogD("Warning: Unknown packet type");
free(binaryPacket);
break;
}
} else {
- LogPedantic("Too few bytes to read packet");
+ WrtLogD("Too few bytes to read packet");
break;
}
}
} else {
- LogPedantic("Too few bytes to read header");
+ WrtLogD("Too few bytes to read header");
}
}