39 #ifndef _uhal_ProtocolControlHub_hpp_ 40 #define _uhal_ProtocolControlHub_hpp_ 44 #include "uhal/log/log.hpp" 64 UHAL_DEFINE_EXCEPTION_CLASS ( XMLfileMissingRequiredParameters , "Exception class to handle the case where the received header does not match the expected header." )
67 UHAL_DEFINE_EXCEPTION_CLASS ( ControlHubReturnedWrongAddress , "Exception class to handle the case where the ControlHub returned the wrong IP or Port" )
73 UHAL_DEFINE_DERIVED_EXCEPTION_CLASS ( ControlHubErrorCodeSet, PacketLevelError , "Exception class to handle cases in which the ControlHub returns a non-zero error code (excluding target timeouts)" )
85 template < typename InnerProtocol >
114 virtual uint32_t getPreambleSize();
132 uint8_t* aSendBufferEnd ,
133 std::deque< std::pair< uint8_t* , uint32_t > >::iterator aReplyStartIt ,
134 std::deque< std::pair< uint8_t* , uint32_t > >::iterator aReplyEndIt );
151 virtual void dispatchExceptionHandler();
155 static void translateErrorCode(std::ostream& aStream,
const uint16_t& aErrorCode);
uint32_t mDeviceIPaddress
The IP address of the target device that is connected to the Control Hub.
uint32_t mReplyChunkByteCounter
A legacy counter.
uint32_t mReplyDeviceIPaddress
The returned target device ID (IP address)
uint16_t * mSendWordCountPtr
The number of 32-bit words in the IPbus packet (legacy and could be removed)
boost::mutex mPreamblesMutex
Mutex to be used when accessing mPreambles.
#define UHAL_DEFINE_EXCEPTION_CLASS(ClassName, ClassDescription)
#define UHAL_DEFINE_DERIVED_EXCEPTION_CLASS(ClassName, BaseClassName, ClassDescription)
Macro for simplifying the declaration and definition of derived exception types.
An abstract base exception class providing an interface to a throw/ThrowAsDerivedType mechanism which...
std::deque< tpreamble > mPreambles
A queue of preample structs making the memory used by the preambles persistent during the dispatch...
A struct representing the preamble which will be prepended to an IPbus buffer for the benefit of the ...
std::pair< uint32_t, uint16_t > ExtractTargetID(const URI &aUri)
Extract an IP-address and port number from a URI object.
Transport protocol to transfer an IPbus buffer via ControlHub.
virtual uint32_t getMaxNumberOfBuffers()
Returns the maximum number of buffers that should be in-flight from the uHAL client at any given time...
uint16_t mReplyErrorCode
An error code returned describing the status of the control hub.
uint16_t mReplyDevicePort
The returned target device ID (port number)
uint16_t mDevicePort
The port number of the target device that is connected to the Control Hub.
Struct to store a URI when parsed by boost spirit.