21 std::vector<char> serializedData = { -1};
22 GetChannel().SetData(serializedData);
30 std::vector<char> serializedData = { -1};
31 GetChannel().SetData(serializedData);
39 std::vector<char> serializedData = {0, -1};
40 GetChannel().SetData(serializedData);
48 std::vector<char> serializedData = {0, -1};
49 GetChannel().SetData(serializedData);
57 std::vector<char> serializedData = {0, -1, 0, -1};
58 GetChannel().SetData(serializedData);
66 std::vector<char> serializedData = {0, -1, 0, -1};
67 GetChannel().SetData(serializedData);
69 GetStream() >> sdword;
75 std::vector<char> serializedData = {0, -1, 0, -1, 0, 0, -1, -1};
76 GetChannel().SetData(serializedData);
84 std::vector<char> serializedData = {0, -1, 0, -1, 0, 0, -1, -1};
85 GetChannel().SetData(serializedData);
87 GetStream() >> sqword;
97 const std::vector<char> serializedData = {0, 0, (char)0xD0, (
char)0xC0};
98 GetChannel().SetData(serializedData);
106 std::vector<char> serializedData = {0, 0, 0, 0, (char)0x80, (
char)0x4f, (char)0x32, (
char)0x41};
107 GetChannel().SetData(serializedData);
119 const std::vector<char> serializedData = {3, 0, 0, 0,
'u',
'r',
'l'};
120 GetChannel().SetData(serializedData);
123 GetStream() >> deserializedString;
126 ASSERT_EQ(deserializedString, expectedString);
144 const std::vector<char> serializedData = { -1, -1, -1, -1};
145 GetChannel().SetData(serializedData);
148 GetStream() >> deserializedString;
151 ASSERT_EQ(deserializedString, expectedString);
161 const std::vector<char> serializedData = {3, 0, 0, 0,
'u',
'r',
'l'};
162 GetChannel().SetData(serializedData);
164 std::vector<uint8_t> deserializedBytes;
165 GetStream() >> deserializedBytes;
167 std::vector<uint8_t> expectedBytes = {
'u',
'r',
'l'};
168 ASSERT_EQ(deserializedBytes, expectedBytes);
173 const std::vector<char> serializedData = { -1, -1, -1, -1};
174 GetChannel().SetData(serializedData);
176 std::vector<uint8_t> deserializedBytes;
177 GetStream() >> deserializedBytes;
179 std::vector<uint8_t> expectedBytes;
180 ASSERT_EQ(deserializedBytes, expectedBytes);
189 const std::vector<char> serializedData = {3, 0, 0, 0,
'u',
'r',
'l'};
190 GetChannel().SetData(serializedData);
192 std::vector<char> deserializedBytes(serializedData.size());
194 GetStream() >> rawBuffer;
196 ASSERT_EQ(rawBuffer.Size, serializedData.size());
197 ASSERT_EQ(deserializedBytes, serializedData);
206 const std::vector<char> serializedData = {3, 2, 0, 0, 0,
'e',
'n', 4, 0, 0, 0,
't',
'e',
'x',
't'};
207 GetChannel().SetData(serializedData);
218 const std::vector<char> serializedData = {1, 2, 0, 0, 0,
'e',
'n', 4, 0, 0, 0,
't',
'e',
'x',
't'};
219 GetChannel().SetData(serializedData);
230 const std::vector<char> serializedData = {2, 2, 0, 0, 0,
'e',
'n', 4, 0, 0, 0,
't',
'e',
'x',
't'};
231 GetChannel().SetData(serializedData);
247 const std::vector<char> serializedData = {
'H',
'E',
'L'};
248 GetChannel().SetData(serializedData);
251 GetStream() >> msgType;
258 const std::vector<char> serializedData = {
'A',
'C',
'K'};
259 GetChannel().SetData(serializedData);
262 GetStream() >> msgType;
269 const std::vector<char> serializedData = {
'E',
'R',
'R'};
270 GetChannel().SetData(serializedData);
273 GetStream() >> msgType;
280 const std::vector<char> serializedData = {
'O',
'P',
'N'};
281 GetChannel().SetData(serializedData);
284 GetStream() >> msgType;
291 const std::vector<char> serializedData = {
'C',
'L',
'O'};
292 GetChannel().SetData(serializedData);
295 GetStream() >> msgType;
302 const std::vector<char> serializedData = {
'I',
'N',
'V'};
303 GetChannel().SetData(serializedData);
315 const std::vector<char> serializedData = {
'F'};
316 GetChannel().SetData(serializedData);
319 GetStream() >> chunkType;
326 const std::vector<char> serializedData = {
'C'};
327 GetChannel().SetData(serializedData);
330 GetStream() >> chunkType;
337 const std::vector<char> serializedData = {
'A'};
338 GetChannel().SetData(serializedData);
341 GetStream() >> chunkType;
348 const std::vector<char> serializedData = {
'I'};
349 GetChannel().SetData(serializedData);
352 ASSERT_THROW(GetStream() >> chunkType, std::logic_error);
362 const std::vector<char> serializedData = {
'H',
'E',
'L',
'F', 4, 3, 2, 1};
363 GetChannel().SetData(serializedData);
380 const std::vector<char> serializedData =
391 GetChannel().SetData(serializedData);
406 const std::vector<char> serializedData =
417 GetChannel().SetData(serializedData);
430 std::vector<char> serializedData =
439 GetChannel().SetData(serializedData);
453 std::vector<char> serializedData =
461 GetChannel().SetData(serializedData);
473 std::vector<char> serializedData =
480 GetChannel().SetData(serializedData);
485 uint32_t tmpInt = 0x01020304;
492 std::vector<char> serializedData =
499 GetChannel().SetData(serializedData);
511 const std::vector<char> serializedData =
519 GetChannel().SetData(serializedData);
536 const std::vector<char> serializedData =
546 GetChannel().SetData(serializedData);
549 GetStream() >> header;
552 const std::vector<uint8_t> cert = {1, 2, 3};
554 const std::vector<uint8_t> thumb = {4, 5, 6};
564 const std::vector<char> serializedData =
569 GetChannel().SetData(serializedData);
572 GetStream() >> header;
582 const std::vector<char> serializedData =
588 GetChannel().SetData(serializedData);
591 GetStream() >> header;
603 using namespace OpcUa;
605 const std::vector<char> expectedData =
617 GetChannel().SetData(expectedData);
620 GetStream() >> header;
623 ASSERT_EQ(header.TypeId.StringData.NamespaceIndex, 0x1);
624 ASSERT_EQ(header.TypeId.StringData.Identifier,
"id");
625 ASSERT_EQ(header.TypeId.NamespaceURI,
"uri");
638 using namespace OpcUa;
640 const std::vector<char> expectedData =
643 2, 0, 0, 0, 0, 0, 0, 0,
647 'a',
'u',
'd',
'i',
't',
654 GetChannel().SetData(expectedData);
657 GetStream() >> header;
679 using namespace OpcUa;
681 const std::vector<char> expectedData =
686 GetChannel().SetData(expectedData);
695 using namespace OpcUa;
697 const std::vector<char> expectedData =
703 GetChannel().SetData(expectedData);
715 using namespace OpcUa;
717 const std::vector<char> expectedData =
724 GetChannel().SetData(expectedData);
736 using namespace OpcUa;
738 const std::vector<char> expectedData =
745 GetChannel().SetData(expectedData);
757 using namespace OpcUa;
759 const std::vector<char> expectedData =
766 GetChannel().SetData(expectedData);
778 using namespace OpcUa;
780 const std::vector<char> expectedData =
787 GetChannel().SetData(expectedData);
798 using namespace OpcUa;
800 const std::vector<char> expectedData =
806 GetChannel().SetData(expectedData);
821 using namespace OpcUa;
823 const std::vector<char> expectedData =
828 GetChannel().SetData(expectedData);
831 GetStream() >> header;
842 using namespace OpcUa;
844 const std::vector<char> expectedData =
846 1, 0, (char)0xbe, 0x1,
851 (uint32_t)SecurityTokenRequestType::Renew, 0, 0, 0,
852 (uint32_t)MessageSecurityMode::Sign, 0, 0, 0,
858 GetChannel().SetData(expectedData);
861 GetStream() >> request;
878 using namespace OpcUa;
880 const std::vector<char> expectedData =
884 3, 0, 0, 0, 0, 0, 0, 0,
888 GetChannel().SetData(expectedData);
891 GetStream() >> token;
905 using namespace OpcUa;
907 const std::vector<char> expectedData =
909 1, 0, (char)0xC1, 0x1,
917 4, 0, 0, 0, 0, 0, 0, 0,
923 GetChannel().SetData(expectedData);
926 GetStream() >> response;
929 ASSERT_EQ(response.TypeId.FourByteData.NamespaceIndex, 0);
934 ASSERT_EQ(response.ServerProtocolVersion, 1);
935 ASSERT_EQ(response.ChannelSecurityToken.SecureChannelId, 2);
936 ASSERT_EQ(response.ChannelSecurityToken.TokenId, 3);
937 ASSERT_EQ(response.ChannelSecurityToken.CreatedAt, 4);
938 ASSERT_EQ(response.ChannelSecurityToken.RevisedLifetime, 5);
939 ASSERT_EQ(response.ServerNonce, std::vector<uint8_t>(1, 6));
949 using namespace OpcUa;
951 const std::vector<char> expectedData =
953 1, 0, (char)0xc4, 0x1,
959 GetChannel().SetData(expectedData);
962 GetStream() >> request;
974 using namespace OpcUa;
976 const std::vector<char> expectedData =
978 3, 0, 0, 0,
'a',
'e',
's',
979 4, 0, 0, 0, 1, 2, 3, 4
982 GetChannel().SetData(expectedData);
997 using namespace OpcUa;
999 const std::vector<char> expectedData =
1001 1, 0, (char)0x41, 0x1,
1005 GetChannel().SetData(expectedData);
1007 GetStream() >> header;
1010 ASSERT_EQ(header.TypeId.FourByteData.NamespaceIndex, 0);
1021 using namespace OpcUa;
1023 const std::vector<char> expectedData =
1026 4, 0, 0, 0,
'n',
'a',
'm',
'e' 1029 GetChannel().SetData(expectedData);
1032 GetStream() >>
name;
1044 using namespace OpcUa;
1047 const std::vector<char> expectedData =
1052 GetChannel().SetData(expectedData);
#define TEST_RESPONSE_HEADER_BINARY_DATA
TEST_F(TestInfoTest, Names)
MessageSecurityMode SecurityMode
std_msgs::Header * header(M &m)
#define ASSERT_REQUEST_HEADER_EQ(header)
std::string AdditionalInfo
struct OpcUa::NodeId::TwoByteDataType TwoByteData
#define ASSERT_THROW(statement, expected_exception)
#define TEST_REQUEST_HEADER_BINARY_DATA
uint32_t ClientProtocolVersion
DiagnosticInfoMask EncodingMask
#define ASSERT_NO_THROW(statement)
OPC UA Address space part. GNU LGPL.
std::vector< uint8_t > ClientNonce
OpenSecureChannelParameters Parameters
#define ASSERT_RESPONSE_HEADER_EQ(header)
#define ASSERT_EQ(val1, val2)
StatusCode InnerStatusCode
uint32_t ReceiveBufferSize
SecurityTokenRequestType RequestType
uint32_t ReceiveBufferSize
OpcUa::ByteString Signature
std::size_t RawSize(const T &obj)