AVT相机arm版本SDK

This commit is contained in:
zhangpeng
2025-04-30 09:26:04 +08:00
parent 837c870f18
commit 78a1c63a95
705 changed files with 148770 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
/*=============================================================================
Copyright (C) 2014 Allied Vision Technologies. All Rights Reserved.
Redistribution of this file, in original or modified form, without
prior written consent of Allied Vision Technologies is prohibited.
-------------------------------------------------------------------------------
File: DiscoverGigECameras.c
Description: Discover GigE cameras if GigE TL is present.
-------------------------------------------------------------------------------
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=============================================================================*/
#include <stdio.h>
#ifdef WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
#include <VimbaC/Include/VimbaC.h>
#include "DiscoverGigECameras.h"
// Purpose: Discovers GigE cameras if GigE TL is present.
// Discovery is switched on only once so that the API can detect all currently connected cameras.
VmbError_t DiscoverGigECameras()
{
VmbError_t err = VmbErrorSuccess;
VmbBool_t isGigE = VmbBoolFalse;
err = VmbFeatureBoolGet( gVimbaHandle, "GeVTLIsPresent", &isGigE ); // Is Vimba connected to a GigE transport layer?
if ( VmbErrorSuccess == err )
{
if( VmbBoolTrue == isGigE )
{
err = VmbFeatureIntSet( gVimbaHandle, "GeVDiscoveryAllDuration", 250 ); // Set the waiting duration for discovery packets to return. If not set the default of 150 ms is used.
if( VmbErrorSuccess == err )
{
err = VmbFeatureCommandRun( gVimbaHandle, "GeVDiscoveryAllOnce" ); // Send discovery packets to GigE cameras and wait 250 ms until they are answered
if( VmbErrorSuccess != err )
{
printf( "Could not ping GigE cameras over the network. Reason: %d\n", err );
}
}
else
{
printf( "Could not set the discovery waiting duration. Reason: %d\n", err );
}
}
}
else
{
printf( "Could not query Vimba for the presence of a GigE transport layer. Reason: %d\n\n", err );
}
return err;
}

View File

@@ -0,0 +1,37 @@
/*=============================================================================
Copyright (C) 2014 Allied Vision Technologies. All Rights Reserved.
Redistribution of this file, in original or modified form, without
prior written consent of Allied Vision Technologies is prohibited.
-------------------------------------------------------------------------------
File: DiscoverGigECameras.h
Description: Discover GigE cameras if GigE TL is present.
-------------------------------------------------------------------------------
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=============================================================================*/
#ifndef DISCOVER_GIGE_CAMERAS_H_
#define DISCOVER_GIGE_CAMERAS_H_
#include <VimbaC/Include/VimbaC.h>
// Purpose: Discovers GigE cameras if GigE TL is present.
// Discovery is switched on only once so that the API can detect all currently connected cameras.
VmbError_t DiscoverGigECameras();
#endif

View File

@@ -0,0 +1,66 @@
/*=============================================================================
Copyright (C) 2014 - 2016 Allied Vision Technologies. All Rights Reserved.
Redistribution of this file, in original or modified form, without
prior written consent of Allied Vision Technologies is prohibited.
-------------------------------------------------------------------------------
File: ErrorCodeToMessage.h
Description: Convert the error codes to a self-explanatory message.
-------------------------------------------------------------------------------
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=============================================================================*/
#include "ErrorCodeToMessage.h"
//
// Translates Vimba error codes to readable error messages
//
// Parameters:
// [in] eError The error code to be converted to string
//
// Returns:
// A descriptive string representation of the error code
//
const char* ErrorCodeToMessage( VmbError_t eError )
{
switch(eError)
{
case VmbErrorSuccess: return "Success.";
case VmbErrorInternalFault: return "Unexpected fault in VmbApi or driver.";
case VmbErrorApiNotStarted: return "API not started.";
case VmbErrorNotFound: return "Not found.";
case VmbErrorBadHandle: return "Invalid handle ";
case VmbErrorDeviceNotOpen: return "Device not open.";
case VmbErrorInvalidAccess: return "Invalid access.";
case VmbErrorBadParameter: return "Bad parameter.";
case VmbErrorStructSize: return "Wrong DLL version.";
case VmbErrorMoreData: return "More data returned than memory provided.";
case VmbErrorWrongType: return "Wrong type.";
case VmbErrorInvalidValue: return "Invalid value.";
case VmbErrorTimeout: return "Timeout.";
case VmbErrorOther: return "TL error.";
case VmbErrorResources: return "Resource not available.";
case VmbErrorInvalidCall: return "Invalid call.";
case VmbErrorNoTL: return "TL not loaded.";
case VmbErrorNotImplemented: return "Not implemented.";
case VmbErrorNotSupported: return "Not supported.";
default: return "Unknown";
}
}

View File

@@ -0,0 +1,44 @@
/*=============================================================================
Copyright (C) 2014 - 2016 Allied Vision Technologies. All Rights Reserved.
Redistribution of this file, in original or modified form, without
prior written consent of Allied Vision Technologies is prohibited.
-------------------------------------------------------------------------------
File: ErrorCodeToMessage.h
Description: Convert the error codes to a self-explanatory message.
-------------------------------------------------------------------------------
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=============================================================================*/
#ifndef ERROR_CODE_TO_MESSAGE_H_
#define ERROR_CODE_TO_MESSAGE_H_
#include "VimbaC/Include/VimbaC.h"
//
// Translates Vimba error codes to readable error messages
//
// Parameters:
// [in] eError The error code to be converted to string
//
// Returns:
// A descriptive string representation of the error code
//
const char* ErrorCodeToMessage( VmbError_t eError );
#endif

View File

@@ -0,0 +1,49 @@
/*=============================================================================
Copyright (C) 2014 - 2016 Allied Vision Technologies. All Rights Reserved.
Redistribution of this file, in original or modified form, without
prior written consent of Allied Vision Technologies is prohibited.
-------------------------------------------------------------------------------
File: PrintVimbaVersion.h
Description: Print Vimba version.
-------------------------------------------------------------------------------
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=============================================================================*/
#include "PrintVimbaVersion.h"
#include <stdio.h>
#include <VimbaC/Include/VimbaC.h>
//
// Prints out the version of the Vimba API
//
void PrintVimbaVersion()
{
VmbVersionInfo_t version_info;
VmbError_t result = VmbVersionQuery( &version_info, sizeof( version_info ));
if( VmbErrorSuccess == result)
{
printf( "Vimba Version Major: %u Minor: %u Patch: %u\n", version_info.major, version_info.minor,version_info.patch );
}
else
{
printf( "VmbVersionQuery failed with Reason: %x\n", result );
}
}

View File

@@ -0,0 +1,36 @@
/*=============================================================================
Copyright (C) 2014 - 2016 Allied Vision Technologies. All Rights Reserved.
Redistribution of this file, in original or modified form, without
prior written consent of Allied Vision Technologies is prohibited.
-------------------------------------------------------------------------------
File: PrintVimbaVersion.h
Description: Print Vimba version.
-------------------------------------------------------------------------------
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=============================================================================*/
#ifndef PRINT_VIMBA_VERSION_H_
#define PRINT_VIMBA_VERSION_H_
//
// Prints out the version of the Vimba API
//
void PrintVimbaVersion();
#endif