EventAdapterU3V.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2013 by Groget
3 // Project: GenApi
4 // Author: Jan Becvar
5 // $Header$
6 //
7 // License: This file is published under the license of the EMVA GenICam Standard Group.
8 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
9 // If for some reason you are missing this file please contact the EMVA or visit the website
10 // (http://www.genicam.org) for a full copy.
11 //
12 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
13 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
14 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
16 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
17 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
18 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
19 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22 // POSSIBILITY OF SUCH DAMAGE.
23 //-----------------------------------------------------------------------------
29 #ifndef GENAPI_EVENTADAPTERU3V_H
30 #define GENAPI_EVENTADAPTERU3V_H
31 
32 #include <GenApi/EventAdapter.h>
33 
34 namespace GENAPI_NAMESPACE
35 {
36 
37  /* ------------------------------------------- */
38  // Declaration of USB3 Vision / GenCP Event message structures
39 
40  // some useful macros
41  #if defined( _MSC_VER )
42  #define PACK_STRUCT
43  #elif defined (__GNUC__)
44  // While gcc-4 understands #pragma pack,
45  // gcc-3 does not
46  #define PACK_STRUCT __attribute__((packed))
47  #else
48  # error Unknown platform
49  #endif
50 
51  // make sure everything is properly packed
52 #pragma pack(push, 1)
53 
55  typedef struct PACK_STRUCT U3V_COMMAND_HEADER
56  {
57  uint32_t Prefix;
58  // CCD
59  uint16_t Flags;
60  uint16_t CommandId;
61  uint16_t Length;
62  uint16_t ReqId;
65  typedef struct PACK_STRUCT U3V_EVENT_DATA
66  {
67  // SCD
68  uint16_t Reserved;
69  uint16_t EventId;
70  uint64_t Timestamp;
71  // Deliberately not mentioning the (optional?) variable sized data
74  typedef struct PACK_STRUCT U3V_EVENT_MESSAGE
75  {
79 
80  const uint32_t U3V_EVENT_PREFIX = 0x45563355;
81  const uint16_t GENCP_EVENT_CMD_ID = 0x0C00;
83  const size_t GENCP_EVENT_BASIC_SIZE = sizeof (U3V_EVENT_MESSAGE);
84 
85  // restore the previous packing
86 #pragma pack(pop)
87  /* ------------------------------------------- */
88 
89 
92  {
93  public:
95  CEventAdapterU3V(INodeMap* pNodeMap = NULL);
96 
98  virtual ~CEventAdapterU3V();
99 
100  virtual void DeliverMessage( const uint8_t msg[], uint32_t numBytes );
101 
103  void DeliverEventMessage(const U3V_EVENT_MESSAGE *pEventMessage);
104 
105  };
106 }
107 
108 #endif // GENAPI_EVENTADAPTERU3V_H
U3V/GenCP EVENT_CMD specific command data.
struct PACK_STRUCT GENAPI_NAMESPACE::U3V_EVENT_DATA U3V_EVENT_DATA
U3V/GenCP EVENT_CMD specific command data.
const size_t GENCP_COMMAND_HEADER_SIZE
GENICAM_INTERFACE INodeMap
Interface to access the node map.
Definition: INode.h:52
const uint16_t GENCP_EVENT_CMD_ID
#define GENAPI_DECL
Definition: GenApiDll.h:55
struct PACK_STRUCT GENAPI_NAMESPACE::U3V_EVENT_MESSAGE U3V_EVENT_MESSAGE
Entire event data message (without the variable-sized data field)
Declaration of the CEventAdapter class.
U3V/GenCP command header.
const size_t GENCP_EVENT_BASIC_SIZE
struct PACK_STRUCT GENAPI_NAMESPACE::U3V_COMMAND_HEADER U3V_COMMAND_HEADER
U3V/GenCP command header.
Connects a U3V Event to a node map.
const uint32_t U3V_EVENT_PREFIX
Entire event data message (without the variable-sized data field)
Lexical analyzer for CIntSwissKnife.
Definition: Autovector.h:48
Delivers Events to ports.
Definition: EventAdapter.h:47


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Mar 17 2021 02:48:40