split client/server protocol version

This commit is contained in:
Michael Davidsaver
2019-05-18 18:23:17 -07:00
parent 1ea70a302b
commit 64453e1f1a
8 changed files with 86 additions and 77 deletions

View File

@ -337,7 +337,7 @@ bool discoverServers(double timeOut)
ByteBuffer sendBuffer(buffer, sizeof(buffer)/sizeof(char));
sendBuffer.putByte(PVA_MAGIC);
sendBuffer.putByte(PVA_VERSION);
sendBuffer.putByte(PVA_CLIENT_PROTOCOL_REVISION);
sendBuffer.putByte((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG) ? 0x80 : 0x00); // data + 7-bit endianess
sendBuffer.putByte((int8_t)CMD_SEARCH); // search
sendBuffer.putInt(4+1+3+16+2+1+2); // "zero" payload

View File

@ -7,6 +7,8 @@
#ifndef PVACONSTANTS_H_
#define PVACONSTANTS_H_
#include <compilerDependencies.h>
#ifdef epicsExportSharedSymbols
# define pvaConstantsepicsExportSharedSymbols
# undef epicsExportSharedSymbols
@ -26,11 +28,14 @@ namespace pvAccess {
/** PVA protocol magic number */
const epics::pvData::int8 PVA_MAGIC = static_cast<epics::pvData::int8>(0xCA);
const epics::pvData::int8 PVA_SERVER_PROTOCOL_REVISION = 1;
const epics::pvData::int8 PVA_CLIENT_PROTOCOL_REVISION = 1;
/** PVA protocol revision (implemented by this library). */
const epics::pvData::int8 PVA_PROTOCOL_REVISION = 1;
const epics::pvData::int8 PVA_PROTOCOL_REVISION EPICS_DEPRECATED = 1;
/** PVA version signature used to report this implementation version in header. */
const epics::pvData::int8 PVA_VERSION = PVA_PROTOCOL_REVISION;
const epics::pvData::int8 PVA_VERSION EPICS_DEPRECATED = 1;
/** Default PVA server port. */
const epics::pvData::int32 PVA_SERVER_PORT = 5075;

View File

@ -207,7 +207,7 @@ void BlockingUDPTransport::flushSendQueue()
void BlockingUDPTransport::startMessage(int8 command, size_t /*ensureCapacity*/, int32 payloadSize) {
_lastMessageStartPosition = _sendBuffer.getPosition();
_sendBuffer.putByte(PVA_MAGIC);
_sendBuffer.putByte(PVA_VERSION);
_sendBuffer.putByte((_clientServerWithEndianFlag&0x40) ? PVA_SERVER_PROTOCOL_REVISION : PVA_CLIENT_PROTOCOL_REVISION);
_sendBuffer.putByte(_clientServerWithEndianFlag);
_sendBuffer.putByte(command); // command
_sendBuffer.putInt(payloadSize);
@ -580,6 +580,8 @@ void initializeUDPTransports(bool serverFlag,
{
BlockingUDPConnector connector(serverFlag);
const int8_t protoVer = serverFlag ? PVA_SERVER_PROTOCOL_REVISION : PVA_CLIENT_PROTOCOL_REVISION;
//
// Create UDP transport for sending (to all network interfaces)
//
@ -590,7 +592,7 @@ void initializeUDPTransports(bool serverFlag,
anyAddress.ia.sin_port = htons(0);
anyAddress.ia.sin_addr.s_addr = htonl(INADDR_ANY);
sendTransport = connector.connect(responseHandler, anyAddress, PVA_PROTOCOL_REVISION);
sendTransport = connector.connect(responseHandler, anyAddress, protoVer);
if (!sendTransport)
{
THROW_BASE_EXCEPTION("Failed to initialize UDP transport.");
@ -730,7 +732,7 @@ void initializeUDPTransports(bool serverFlag,
listenLocalAddress.ia.sin_addr.s_addr = node.addr.ia.sin_addr.s_addr;
BlockingUDPTransport::shared_pointer transport = connector.connect(
responseHandler, listenLocalAddress, PVA_PROTOCOL_REVISION);
responseHandler, listenLocalAddress, protoVer);
if (!transport)
continue;
listenLocalAddress = transport->getRemoteAddress();
@ -764,7 +766,7 @@ void initializeUDPTransports(bool serverFlag,
bcastAddress.ia.sin_port = htons(listenPort);
bcastAddress.ia.sin_addr.s_addr = node.bcast.ia.sin_addr.s_addr;
transport2 = connector.connect(responseHandler, bcastAddress, PVA_PROTOCOL_REVISION);
transport2 = connector.connect(responseHandler, bcastAddress, protoVer);
if (transport2)
{
/* The other wrinkle is that nothing should be sent from this second
@ -824,7 +826,7 @@ void initializeUDPTransports(bool serverFlag,
#else
anyAddress,
#endif
PVA_PROTOCOL_REVISION);
protoVer);
if (!localMulticastTransport)
throw std::runtime_error("Failed to bind UDP socket.");

View File

@ -206,7 +206,7 @@ void ChannelSearchManager::initializeSendBuffer()
// new buffer
m_sendBuffer.clear();
m_sendBuffer.putByte(PVA_MAGIC);
m_sendBuffer.putByte(PVA_VERSION);
m_sendBuffer.putByte(PVA_CLIENT_PROTOCOL_REVISION);
m_sendBuffer.putByte((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG) ? 0x80 : 0x00); // data + 7-bit endianess
m_sendBuffer.putByte(CMD_SEARCH);
m_sendBuffer.putInt(4+1+3+16+2+1); // "zero" payload

View File

@ -591,7 +591,7 @@ void AbstractCodec::startMessage(
PVA_MESSAGE_HEADER_SIZE + ensureCapacity + _nextMessagePayloadOffset);
_lastMessageStartPosition = _sendBuffer.getPosition();
_sendBuffer.putByte(PVA_MAGIC);
_sendBuffer.putByte(PVA_VERSION);
_sendBuffer.putByte(_clientServerFlag ? PVA_SERVER_PROTOCOL_REVISION : PVA_CLIENT_PROTOCOL_REVISION);
_sendBuffer.putByte(
(_lastSegmentedMessageType | _byteOrderFlag | _clientServerFlag)); // data message
_sendBuffer.putByte(command); // command
@ -612,7 +612,7 @@ void AbstractCodec::putControlMessage(
std::numeric_limits<size_t>::max(); // TODO revise this
ensureBuffer(PVA_MESSAGE_HEADER_SIZE);
_sendBuffer.putByte(PVA_MAGIC);
_sendBuffer.putByte(PVA_VERSION);
_sendBuffer.putByte(_clientServerFlag ? PVA_SERVER_PROTOCOL_REVISION : PVA_CLIENT_PROTOCOL_REVISION);
_sendBuffer.putByte((0x01 | _byteOrderFlag | _clientServerFlag)); // control message
_sendBuffer.putByte(command); // command
_sendBuffer.putInt(data); // data
@ -1472,7 +1472,7 @@ void BlockingServerTCPTransportCodec::send(ByteBuffer* buffer,
ensureBuffer(PVA_MESSAGE_HEADER_SIZE);
buffer->putByte(PVA_MAGIC);
buffer->putByte(PVA_VERSION);
buffer->putByte(PVA_SERVER_PROTOCOL_REVISION);
buffer->putByte(
0x01 | 0x40 | ((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG)
? 0x80 : 0x00)); // control + server + endian

View File

@ -289,7 +289,9 @@ private:
std::size_t _nextMessagePayloadOffset;
epics::pvData::int8 _byteOrderFlag;
protected:
epics::pvData::int8 _clientServerFlag;
private:
const size_t _socketSendBufferSize;
public:
@ -365,8 +367,8 @@ public:
epics::pvData::int8 getRevision() const {
epicsGuard<epicsMutex> G(_mutex);
return PVA_PROTOCOL_REVISION < _version
? PVA_PROTOCOL_REVISION : _version;
int8_t myver = _clientServerFlag ? PVA_SERVER_PROTOCOL_REVISION : PVA_CLIENT_PROTOCOL_REVISION;
return myver < _version ? myver : _version;
}

View File

@ -3597,7 +3597,7 @@ public:
// NOTE: calls channelConnectFailed() on failure
static ServerGUID guid = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
// m_addresses[ix] is modified by the following
searchResponse(guid, PVA_PROTOCOL_REVISION, &m_addresses[ix]);
searchResponse(guid, PVA_CLIENT_PROTOCOL_REVISION, &m_addresses[ix]);
}
virtual void timerStopped() OVERRIDE FINAL {

View File

@ -483,7 +483,7 @@ private:
TestCodec codec(DEFAULT_BUFFER_SIZE,DEFAULT_BUFFER_SIZE);
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x01);
codec._readBuffer->put((int8_t)0x23);
codec._readBuffer->putInt(0x456789AB);
@ -506,8 +506,8 @@ private:
PVAMessage header = codec._receivedControlMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(codec._invalidDataStreamCount == 0,
"%s: codec._invalidDataStreamCount == 0",
@ -523,13 +523,13 @@ private:
// two at the time, app and control
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x00);
codec._readBuffer->put((int8_t)0x20);
codec._readBuffer->putInt(0x00000000);
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x81);
codec._readBuffer->put((int8_t)0xEE);
codec._readBuffer->putInt(0xDDCCBBAA);
@ -553,8 +553,8 @@ private:
// app, no payload
header = codec._receivedAppMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)0x00,
"%s: header._flags == 0x00", CURRENT_FUNCTION);
testOk(header._command == (int8_t)0x20,
@ -565,8 +565,8 @@ private:
// control
header = codec._receivedControlMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)0x81,
"%s: header._flags == 0x81", CURRENT_FUNCTION);
testOk(header._command == (int8_t)0xEE,
@ -585,7 +585,7 @@ private:
TestCodec codec(DEFAULT_BUFFER_SIZE,DEFAULT_BUFFER_SIZE);
codec._readBuffer->put((int8_t)00);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x01);
codec._readBuffer->put((int8_t)0x23);
codec._readBuffer->putInt(0x456789AB);
@ -621,7 +621,7 @@ private:
{
TestCodec codec(DEFAULT_BUFFER_SIZE,DEFAULT_BUFFER_SIZE);
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put(invalidFlagsValues[i]);
codec._readBuffer->put((int8_t)0x23);
//codec._readBuffer->putInt(0);
@ -653,7 +653,7 @@ private:
TestCodec codec(DEFAULT_BUFFER_SIZE,DEFAULT_BUFFER_SIZE);
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x80);
codec._readBuffer->put((int8_t)0x23);
codec._readBuffer->putInt(0x456789AB);
@ -682,7 +682,7 @@ private:
TestCodec codec(DEFAULT_BUFFER_SIZE,DEFAULT_BUFFER_SIZE);
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x01);
codec._readBuffer->flip();
@ -724,8 +724,8 @@ private:
// app, no payload
PVAMessage header = codec._receivedControlMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)0x01,
"%s: header._flags == 0x01", CURRENT_FUNCTION);
testOk(header._command == (int8_t)0x23,
@ -744,7 +744,7 @@ private:
codec._readPayload = true;
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x80);
codec._readBuffer->put((int8_t)0x23);
codec._readBuffer->putInt(1); // size
@ -790,7 +790,7 @@ private:
codec._readPayload = true;
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x80);
codec._readBuffer->put((int8_t)0x23);
const int32_t payloadSize1 = 2;
@ -806,7 +806,7 @@ private:
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x80);
codec._readBuffer->put((int8_t)0x45);
@ -912,7 +912,7 @@ private:
_codec._readBuffer->put(PVA_MAGIC);
_codec._readBuffer->put(PVA_VERSION);
_codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
_codec._readBuffer->put((int8_t)0x80);
_codec._readBuffer->put((int8_t)0x45);
_codec._readBuffer->putInt(_payloadSize2);
@ -958,7 +958,7 @@ private:
// 1st
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x90);
codec._readBuffer->put((int8_t)0x01);
@ -971,7 +971,7 @@ private:
// 2nd
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0xB0);
codec._readBuffer->put((int8_t)0x01);
@ -983,14 +983,14 @@ private:
// control in between
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x81);
codec._readBuffer->put((int8_t)0xEE);
codec._readBuffer->putInt(0xDDCCBBAA);
// 3rd
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0xB0);
codec._readBuffer->put((int8_t)0x01);
@ -1002,7 +1002,7 @@ private:
// 4t (last)
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0xA0);
codec._readBuffer->put((int8_t)0x01);
@ -1057,8 +1057,8 @@ private:
msg = codec._receivedControlMessages[0];
testOk(msg._version == PVA_VERSION,
"%s: msg._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(msg._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: msg._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(msg._flags == (int8_t)0x81,
"%s: msg._flags == 0x81", CURRENT_FUNCTION);
testOk(msg._command == (int8_t)0xEE,
@ -1078,7 +1078,7 @@ private:
// 1st
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x90);
codec._readBuffer->put((int8_t)0x01);
@ -1091,7 +1091,7 @@ private:
// 2nd
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
// invalid flag, should be 0xB0
codec._readBuffer->put((int8_t)0x90);
codec._readBuffer->put((int8_t)0x01);
@ -1104,14 +1104,14 @@ private:
// control in between
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x81);
codec._readBuffer->put((int8_t)0xEE);
codec._readBuffer->putInt(0xDDCCBBAA);
// 3rd
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0xB0);
codec._readBuffer->put((int8_t)0x01);
@ -1123,7 +1123,7 @@ private:
// 4t (last)
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0xA0);
codec._readBuffer->put((int8_t)0x01);
@ -1172,7 +1172,7 @@ private:
// 1st
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x90);
codec._readBuffer->put((int8_t)0x01);
@ -1190,7 +1190,7 @@ private:
// 2nd
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0xB0);
codec._readBuffer->put((int8_t)0x01);
@ -1209,7 +1209,7 @@ private:
// 3rd
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0xB0);
codec._readBuffer->put((int8_t)0x01);
@ -1227,7 +1227,7 @@ private:
// 4t (last)
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0xA0);
codec._readBuffer->put((int8_t)0x01);
@ -1339,7 +1339,7 @@ private:
// 1st
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x90);
codec._readBuffer->put((int8_t)0x01);
@ -1357,7 +1357,7 @@ private:
// 2nd
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0xB0);
codec._readBuffer->put((int8_t)0x01);
@ -1377,7 +1377,7 @@ private:
// 3rd
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0xA0);
codec._readBuffer->put((int8_t)0x01);
@ -1499,8 +1499,8 @@ private:
PVAMessage header = codec._receivedControlMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG ? 0x80 : 0x00) | 0x01),
"%s: header._flags == 0x(0|8)1", CURRENT_FUNCTION);
testOk(header._command == (int8_t)0x23,
@ -1537,8 +1537,8 @@ private:
// app, no payload
header = codec._receivedAppMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)0x00,
"%s: header._flags == 0x00", CURRENT_FUNCTION);
testOk(header._command == (int8_t)0x20,
@ -1549,8 +1549,8 @@ private:
// control
header = codec._receivedControlMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)0x81,
"%s: header._flags == 0x81", CURRENT_FUNCTION);
testOk(header._command == (int8_t)0xEE,
@ -1878,7 +1878,7 @@ private:
codec._disconnected = true;
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x01);
codec._readBuffer->put((int8_t)0x23);
codec._readBuffer->putInt(0x456789AB);
@ -1953,7 +1953,7 @@ private:
// 1st
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0x90);
codec._readBuffer->put((int8_t)0x01);
@ -1971,7 +1971,7 @@ private:
// 2nd
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0xB0);
codec._readBuffer->put((int8_t)0x01);
@ -1991,7 +1991,7 @@ private:
// 3rd
codec._readBuffer->put(PVA_MAGIC);
codec._readBuffer->put(PVA_VERSION);
codec._readBuffer->put(PVA_CLIENT_PROTOCOL_REVISION);
codec._readBuffer->put((int8_t)0xA0);
codec._readBuffer->put((int8_t)0x01);
@ -2156,8 +2156,8 @@ private:
// app, no payload
PVAMessage header = codec._receivedAppMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG ? 0x80 : 0x00) | 0x00),
"%s: header._flags == 0x(0|8)0", CURRENT_FUNCTION);
testOk(header._command == (int8_t)0x20,
@ -2168,8 +2168,8 @@ private:
// control
header = codec._receivedControlMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG ? 0x80 : 0x00) | 0x01),
"%s: header._flags == 0x(0|8)1", CURRENT_FUNCTION);
testOk(header._command == (int8_t)0xEE,
@ -2293,8 +2293,8 @@ private:
// app, no payload
PVAMessage header = codec._receivedAppMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG ? 0x80 : 0x00) | 0x00),
"%s: header._flags == 0x(0|8)0", CURRENT_FUNCTION);
testOk(header._command == 0x20,
@ -2306,8 +2306,8 @@ private:
// control
header = codec._receivedControlMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG ? 0x80 : 0x00) | 0x01),
"%s: header._flags == 0x(0|8)1", CURRENT_FUNCTION);
testOk(header._command == (int8_t)0xEE,
@ -2363,8 +2363,8 @@ private:
header = codec._receivedControlMessages[1];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG ? 0x80 : 0x00) | 0x01),
"%s: header._flags == 0x(0|8)1", CURRENT_FUNCTION);
testOk(header._command == (int8_t)0xEE,
@ -2443,8 +2443,8 @@ private:
// app
PVAMessage header = codec._receivedAppMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)0x80,
"%s: header._flags == 0x80", CURRENT_FUNCTION);
testOk(header._command == (int8_t)0x12,
@ -2640,8 +2640,8 @@ private:
// app
PVAMessage header = codec._receivedAppMessages[0];
testOk(header._version == PVA_VERSION,
"%s: header._version == PVA_VERSION", CURRENT_FUNCTION);
testOk(header._version == PVA_CLIENT_PROTOCOL_REVISION,
"%s: header._version == PVA_CLIENT_PROTOCOL_REVISION", CURRENT_FUNCTION);
testOk(header._flags == (int8_t)((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG ? 0x80 : 0x00) | 0x10),
"%s: header._flags == (int8_t)(0x(0|8)0 | 0x10)",
CURRENT_FUNCTION);