libvisiontransfer  10.8.0
internalinformation.h
1 /*******************************************************************************
2  * Copyright (c) 2024 Allied Vision Technologies GmbH
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *******************************************************************************/
14 
15 #ifndef VISIONTRANSFER_INTERNALINFORMATION_H
16 #define VISIONTRANSFER_INTERNALINFORMATION_H
17 
18 namespace visiontransfer {
19 namespace internal {
20 
25 struct InternalInformation {
26 #pragma pack(push,1)
27  struct DiscoveryMessageBasic {
28  unsigned char protocolVersion;
29  unsigned char model;
30  unsigned char useTcp;
31  char firmwareVersion[14];
32  };
33  struct DiscoveryMessageWithStatus: public DiscoveryMessageBasic {
34  // Extended device status / health info
35  double lastFps; // Most recent FPS report, or 0.0 if N/A
36  unsigned int jumboSize; // Jumbo MTU or 0 if disabled
37  char currentCaptureSource[8]; // For targeted debug instructions
38  };
39  struct DiscoveryMessageExtensibleV0: public DiscoveryMessageWithStatus {
40  // Reported extension version (increase when new fields appended)
41  unsigned char discoveryExtensionVersion;
42  };
43  struct DiscoveryMessageExtensibleV1: public DiscoveryMessageExtensibleV0 {
44  char serialNumber[32];
45  };
46  // Alias the most current version
47  struct DiscoveryMessage: public DiscoveryMessageExtensibleV1 {
48  };
49 #pragma pack(pop)
50 
51  static const char DISCOVERY_BROADCAST_MSG_LEGACY[16];
52  static const char DISCOVERY_BROADCAST_MSG[25];
53 
54  static constexpr int DISCOVERY_BROADCAST_PORT = 7680;
55  static constexpr int IMAGEDATA_PORT = 7681;
56  static constexpr int WEBSOCKET_PORT = 7682;
57  static constexpr int PARAMETER_PORT = 7683;
58  static constexpr int DATACHANNELSERVICE_PORT = 7684;
59  static constexpr int PARAMETER_WEBSOCKET_PORT = 7685;
60 
61  static constexpr unsigned char CURRENT_PROTOCOL_VERSION = 0x06;
62  static constexpr unsigned char CURRENT_PARAMETER_PROTOCOL_VERSION_MAJOR = 0x07;
63  static constexpr unsigned char CURRENT_PARAMETER_PROTOCOL_VERSION_MINOR = 0x02;
64 
65  static constexpr unsigned char CURRENT_DISCOVERY_EXTENSION_VERSION = 0x01;
66 };
67 
68 }} // namespace
69 
70 #endif
Allied Vision