Beispiel #1
0
        public VisionListener(int port)
        {
            _port           = port;
            _visionListener = VisionListener_Create(_port);

            /// Ensure callbacks we pass to native code are allocated outside our class
            /// see issue #11
            p_onError           = new VisionListener_OnErrorCallback(OnError);
            p_onConnect         = new VisionListener_OnConnectCallback(OnConnect);
            p_onDisconnect      = new VisionListener_OnDisconnectCallback(OnDisconnect);
            p_onObstacleMessage = new VisionListener_OnObstacleMessageCallback(OnObstacleMessage);
            p_onSurfaceMessage  = new VisionListener_OnSurfaceMessageCallback(OnSurfaceMessage);

            VisionListener_OnError(_visionListener, p_onError);
            VisionListener_OnConnect(_visionListener, p_onConnect);
            VisionListener_OnDisconnect(_visionListener, p_onDisconnect);
            VisionListener_OnObstacleMessage(_visionListener, p_onObstacleMessage);
            VisionListener_OnSurfaceMessage(_visionListener, p_onSurfaceMessage);
        }
Beispiel #2
0
 private static extern void VisionListener_OnObstacleMessage(IntPtr vl, VisionListener_OnObstacleMessageCallback callback);