Skip to content

Commit ade15c4

Browse files
committed
Initial extraction from tiscamera
0 parents  commit ade15c4

File tree

130 files changed

+28785
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+28785
-0
lines changed

CMakeLists.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright 2021 The Imaging Source Europe GmbH
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
#Specify the version being used aswell as the language
16+
cmake_minimum_required(VERSION 3.2)
17+
18+
#Name your project here
19+
project(tcam-firmware-update)
20+
21+
22+
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
23+
SET(CMAKE_INSTALL_PREFIX "/usr/" CACHE PATH "Common prefix for all installed files." FORCE)
24+
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
25+
26+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
27+
28+
set(TCAM_FW_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
29+
set(TCAM_FW_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
30+
31+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${TCAM_FW_BINARY_DIR}/bin)
32+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${TCAM_FW_BINARY_DIR}/lib)
33+
34+
find_package(libusb-1.0 REQUIRED QUIET)
35+
find_package(LibZip REQUIRED QUIET)
36+
37+
add_subdirectory(external/PugiXml EXCLUDE_FROM_ALL)
38+
39+
add_subdirectory(src)

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
3+
# What is this
4+
5+
This tool allows you to update the firmware of your TIS USB camera under Linux.
6+
7+
# Usage
8+
9+
### examples
10+
11+
List all available cameras:
12+
firmware-update -l
13+
14+
Get information about a single camera:
15+
firmware-update -id <serial number>
16+
17+
Apply firmware
18+
firmware-update -ud <serial number> -f firmware-file
19+
20+
Switch camera to UVC/proprietary mode
21+
firmware-update -d <serialnumber> -m uvc
22+
firmware-update -d <serialnumber> -m proprietary
23+
24+
Switching to uvc mode is only necessary for USB2 cameras.
25+
26+
# Firmware Files
27+
28+
# Usb2
29+
30+
Firmware file for usb-2.0 cameras are located in data/firmware/usb2
31+
32+
# Usb3
33+
34+
If you need firmware files for USB3 cameras,
35+
please send us a request.
36+
37+
http://www.theimagingsource.com/en_US/company/contact/
38+
39+
# Building
40+
41+
## Dependencies
42+
43+
Required dependencies are:
44+
45+
libusb-1.0
46+
libzip
47+
48+
For compilation additional dev packages may be required.
49+
50+
## Compiling
51+
52+
mkdir tcam-firmware-update/build
53+
cd tcam-firmware-update/build
54+
cmake ..
55+
make
56+
57+
# License
58+
59+
tcam-firmware-update is released under the Apache 2.0 license.
60+
61+
This project includes:
62+
- 7z, which is published as public domain.
63+
- PugiXml 1.6, which is available under the "MIT" license.

cmake/FindLibZip.cmake

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Locate libzip
2+
# This module defines
3+
# LIBZIP_LIBRARY
4+
# LIBZIP_FOUND, if false, do not try to link to libzip
5+
# LIBZIP_INCLUDE_DIR, where to find the headers
6+
#
7+
8+
FIND_PATH(LIBZIP_INCLUDE_DIR zip.h
9+
$ENV{LIBZIP_DIR}/include
10+
$ENV{LIBZIP_DIR}
11+
/usr/local/include
12+
/usr/include
13+
)
14+
15+
FIND_LIBRARY(LIBZIP_LIBRARY
16+
NAMES libzip zip
17+
PATHS
18+
$ENV{LIBZIP_DIR}/lib
19+
$ENV{LIBZIP_DIR}
20+
/usr/local/lib
21+
/usr/lib
22+
23+
)
24+
25+
SET(LIBZIP_FOUND "NO")
26+
IF(LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR)
27+
SET(LIBZIP_FOUND "YES")
28+
ENDIF(LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR)

cmake/Findlibusb-1.0.cmake

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# - Try to find libusb-1.0
2+
# Once done this will define
3+
#
4+
# LIBUSB_1_FOUND - system has libusb
5+
# LIBUSB_1_INCLUDE_DIRS - the libusb include directory
6+
# LIBUSB_1_LIBRARIES - Link these to use libusb
7+
# LIBUSB_1_DEFINITIONS - Compiler switches required for using libusb
8+
#
9+
# Adapted from cmake-modules Google Code project
10+
#
11+
# Copyright (c) 2006 Andreas Schneider <[email protected]>
12+
#
13+
# (Changes for libusb) Copyright (c) 2008 Kyle Machulis <[email protected]>
14+
#
15+
# Redistribution and use is allowed according to the terms of the New BSD license.
16+
#
17+
# CMake-Modules Project New BSD License
18+
#
19+
# Redistribution and use in source and binary forms, with or without
20+
# modification, are permitted provided that the following conditions are met:
21+
#
22+
# * Redistributions of source code must retain the above copyright notice, this
23+
# list of conditions and the following disclaimer.
24+
#
25+
# * Redistributions in binary form must reproduce the above copyright notice,
26+
# this list of conditions and the following disclaimer in the
27+
# documentation and/or other materials provided with the distribution.
28+
#
29+
# * Neither the name of the CMake-Modules Project nor the names of its
30+
# contributors may be used to endorse or promote products derived from this
31+
# software without specific prior written permission.
32+
#
33+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
34+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
35+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
37+
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
38+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
39+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
40+
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
42+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43+
#
44+
45+
46+
if (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
47+
# in cache already
48+
set(LIBUSB_FOUND TRUE)
49+
else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
50+
find_path(LIBUSB_1_INCLUDE_DIR
51+
NAMES
52+
libusb.h
53+
PATHS
54+
/usr/include
55+
/usr/local/include
56+
/opt/local/include
57+
/sw/include
58+
PATH_SUFFIXES
59+
libusb-1.0
60+
)
61+
62+
find_library(LIBUSB_1_LIBRARY
63+
NAMES
64+
usb-1.0 usb
65+
PATHS
66+
/usr/lib
67+
/usr/local/lib
68+
/opt/local/lib
69+
/sw/lib
70+
)
71+
72+
set(LIBUSB_1_INCLUDE_DIRS
73+
${LIBUSB_1_INCLUDE_DIR}
74+
)
75+
set(LIBUSB_1_LIBRARIES
76+
${LIBUSB_1_LIBRARY}
77+
)
78+
79+
if (LIBUSB_1_INCLUDE_DIRS AND LIBUSB_1_LIBRARIES)
80+
set(LIBUSB_1_FOUND TRUE)
81+
endif (LIBUSB_1_INCLUDE_DIRS AND LIBUSB_1_LIBRARIES)
82+
83+
if (LIBUSB_1_FOUND)
84+
if (NOT libusb-1.0_FIND_QUIETLY)
85+
message(STATUS "Found libusb-1.0:")
86+
message(STATUS " - Includes: ${LIBUSB_1_INCLUDE_DIRS}")
87+
message(STATUS " - Libraries: ${LIBUSB_1_LIBRARIES}")
88+
endif (NOT libusb-1.0_FIND_QUIETLY)
89+
else (LIBUSB_1_FOUND)
90+
if (libusb_1_FIND_REQUIRED)
91+
message(FATAL_ERROR "Could not find libusb")
92+
endif (libusb_1_FIND_REQUIRED)
93+
endif (LIBUSB_1_FOUND)
94+
95+
# show the LIBUSB_1_INCLUDE_DIRS and LIBUSB_1_LIBRARIES variables only in the advanced view
96+
mark_as_advanced(LIBUSB_1_INCLUDE_DIRS LIBUSB_1_LIBRARIES)
97+
98+
endif (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)

external/PugiXml/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# Copyright 2018 The Imaging Source Europe GmbH
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
set(pugi_files
18+
pugixml.cpp)
19+
20+
add_library(pugixml_obj OBJECT ${pugi_files})

external/PugiXml/pugi.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright 2018 The Imaging Source Europe GmbH
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* This is a custom wrapper around the PugiXml header
19+
* It does not change any implementation details
20+
* It only exists to surpress compiler warning for this 3rd party lib
21+
*/
22+
23+
#pragma GCC system_header
24+
#include "pugixml.hpp"

external/PugiXml/pugiconfig.hpp

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/**
2+
* pugixml parser - version 1.6
3+
* --------------------------------------------------------
4+
* Copyright (C) 2006-2015, by Arseny Kapoulkine ([email protected])
5+
* Report bugs and download new versions at http://pugixml.org/
6+
*
7+
* This library is distributed under the MIT License. See notice at the end
8+
* of this file.
9+
*
10+
* This work is based on the pugxml parser, which is:
11+
* Copyright (C) 2003, by Kristen Wegner ([email protected])
12+
*/
13+
14+
#ifndef HEADER_PUGICONFIG_HPP
15+
#define HEADER_PUGICONFIG_HPP
16+
17+
// Uncomment this to enable wchar_t mode
18+
// #define PUGIXML_WCHAR_MODE
19+
20+
// Uncomment this to disable XPath
21+
// #define PUGIXML_NO_XPATH
22+
23+
// Uncomment this to disable STL
24+
// #define PUGIXML_NO_STL
25+
26+
// Uncomment this to disable exceptions
27+
#define PUGIXML_NO_EXCEPTIONS
28+
29+
// Set this to control attributes for public classes/functions, i.e.:
30+
// #define PUGIXML_API __declspec(dllexport) // to export all public symbols from DLL
31+
// #define PUGIXML_CLASS __declspec(dllimport) // to import all classes from DLL
32+
// #define PUGIXML_FUNCTION __fastcall // to set calling conventions to all public functions to fastcall
33+
// In absence of PUGIXML_CLASS/PUGIXML_FUNCTION definitions PUGIXML_API is used instead
34+
35+
// Tune these constants to adjust memory-related behavior
36+
// #define PUGIXML_MEMORY_PAGE_SIZE 32768
37+
// #define PUGIXML_MEMORY_OUTPUT_STACK 10240
38+
// #define PUGIXML_MEMORY_XPATH_PAGE_SIZE 4096
39+
40+
// Uncomment this to switch to header-only version
41+
#define PUGIXML_HEADER_ONLY
42+
43+
// Uncomment this to enable long long support
44+
// #define PUGIXML_HAS_LONG_LONG
45+
46+
#endif
47+
48+
/**
49+
* Copyright (c) 2006-2015 Arseny Kapoulkine
50+
*
51+
* Permission is hereby granted, free of charge, to any person
52+
* obtaining a copy of this software and associated documentation
53+
* files (the "Software"), to deal in the Software without
54+
* restriction, including without limitation the rights to use,
55+
* copy, modify, merge, publish, distribute, sublicense, and/or sell
56+
* copies of the Software, and to permit persons to whom the
57+
* Software is furnished to do so, subject to the following
58+
* conditions:
59+
*
60+
* The above copyright notice and this permission notice shall be
61+
* included in all copies or substantial portions of the Software.
62+
*
63+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
64+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
65+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
66+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
67+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
68+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
69+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
70+
* OTHER DEALINGS IN THE SOFTWARE.
71+
*/

0 commit comments

Comments
 (0)