summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--CMakeLists.txt70
-rw-r--r--README28
-rw-r--r--debian/changelog5
-rw-r--r--debian/compat1
-rw-r--r--debian/control21
-rw-r--r--debian/copyright24
-rw-r--r--debian/format1
-rwxr-xr-xdebian/rules4
-rw-r--r--packaging/sd-mux-ctrl.changes2
-rw-r--r--packaging/sd-mux-ctrl.spec42
-rw-r--r--src/CMakeLists.txt46
-rw-r--r--src/main.cpp28
13 files changed, 273 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..f714041
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
+Adam Malinowski <a.malinowsk2@partner.samsung.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..9249439
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,70 @@
+# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file CMakeLists.txt
+# @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
+#
+
+############################# Check minimum CMake version #####################
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
+PROJECT("sd-mux-ctrl")
+set(SDMUXCTRL_VERSION 0.0.1)
+
+############################# cmake packages ##################################
+
+INCLUDE(FindPkgConfig)
+INCLUDE(CheckCXXCompilerFlag)
+
+############################# install dirs ##################################
+
+SET(BIN_INSTALL_DIR
+ "${CMAKE_INSTALL_PREFIX}/bin"
+ CACHE PATH
+ "Binary installation directory")
+
+############################# compiler flags ##################################
+
+SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -g -pg")
+SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb")
+SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -g")
+SET(CMAKE_CXX_FLAGS_CCOV "-O2 -g --coverage")
+
+# Check for C++11 support and enable proper compilation flags
+CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+IF(COMPILER_SUPPORTS_CXX11)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ELSEIF(COMPILER_SUPPORTS_CXX0X)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+ELSE()
+ MESSAGE(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
+ENDIF()
+
+# Set compiler warning flags
+ADD_DEFINITIONS("-Werror") # Make all warnings into errors.
+ADD_DEFINITIONS("-Wall") # Generate all warnings
+ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings
+
+# Don't export symbols by default
+ADD_DEFINITIONS("-fvisibility=hidden")
+
+
+IF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
+ ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG")
+ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
+
+SET(TARGET_SDMUXCTRL "sd-mux-ctrl")
+
+ADD_SUBDIRECTORY(src)
diff --git a/README b/README
new file mode 100644
index 0000000..9ea9c40
--- /dev/null
+++ b/README
@@ -0,0 +1,28 @@
+sd-mux stands for Secure Digital Multiplexer.
+
+This is SD card switcher (multiplexer) designed to help automatic testing.
+
+This project is sd-mux controller - binary for controlling sd-mux device.
+
+Requirements:
+ 1. libftdi1 1.2 - development library
+ 2. popt - development library
+ 3. cmake - binary tool
+
+Build:
+ - enter into project directory
+ - create 'build' directory
+ - enter into "build" directory
+ - run 'cmake ..'
+ - run 'make'
+
+Install:
+ - enter into 'build' directory
+ - run 'sudo make install' to install binary into '/usr/local/bin' (the default one) directory
+
+Note:
+If you want to install files into different directory then add argument to cmake command:
+ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
+Then again run:
+ make
+ make install
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..d84a7e8
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+sd-mux-ctrl (0.0.1) UNRELEASED; urgency=medium
+
+ * Initial release.
+
+ -- Adam Malinowski <a.malinowsk2@partner.samsung.com> Tue, 16 Feb 2016 09:31:30 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..d6d09b1
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,21 @@
+Source: sd-mux-ctrl
+Maintainer: Adam Malinowski <a.malinowsk2@partner.samsung.com>
+Section: utils
+Priority: optional
+Build-Depends: libftdi1-dev (>= 1.2),
+ libpopt-dev,
+ debhelper (>=9),
+Standards-Version: 3.9.5
+
+Package: sd-mux-ctrl
+Architecture: any
+Depends: libftdi1-2 (>=1.2),
+ libpopt0,
+ ${misc:Depends},
+ ${shlibs:Depends},
+Description: Tool for controlling multiple sd-mux devices.
+ This tool allows:
+ to connect SD card to DUT (Device Under Test) or to TS (Test Server)
+ to connect one USB port to DUT or TS
+ to power off or on DUT
+ to reset DUT through power disconnecting and reconnecting
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..606a0ee
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,24 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Source: git://git.tizen.org/tools/testlab/sd-mux
+
+Files: *
+Copyright: (C) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+License: Apache-2.0
+
+Files: debian/*
+Copyright: (C) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+License: Apache-2.0
+
+License: Apache-2.0
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ .
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ .
+ On Debian systems, the full text of the Apache License, Version 2.0
+ can be found in the file `/usr/share/common-licenses/Apache-2.0'.
+
diff --git a/debian/format b/debian/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..2d33f6a
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,4 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
diff --git a/packaging/sd-mux-ctrl.changes b/packaging/sd-mux-ctrl.changes
new file mode 100644
index 0000000..61f68f4
--- /dev/null
+++ b/packaging/sd-mux-ctrl.changes
@@ -0,0 +1,2 @@
+* Tue Feb 16 2016 Adam Malinowski <a.malinowsk2@partner.samsung.com> 0.0.1
+- Initial release
diff --git a/packaging/sd-mux-ctrl.spec b/packaging/sd-mux-ctrl.spec
new file mode 100644
index 0000000..367b72a
--- /dev/null
+++ b/packaging/sd-mux-ctrl.spec
@@ -0,0 +1,42 @@
+%define rc_version 0
+
+%if 0%{?rc_version}
+%define release_prefix 0.rc%{rc_version}.
+%endif
+
+Name: sd-mux-ctrl
+Summary: Control software for sd-mux devices.
+Version: 0.0.1
+Release: %{?release_prefix}%{?opensuse_bs:<CI_CNT>.<B_CNT>}%{!?opensuse_bs:0}
+Group: Development/Tools
+License: Apache-2.0
+URL: http://www.tizen.org
+Source0: %{name}_%{version}.tar.gz
+BuildRequires: cmake
+Requires: libftdi >= 1.2
+Requires: popt
+
+BuildRoot: %{_tmppath}/%{name}_%{version}-build
+
+%description
+Tool for controlling multiple sd-mux devices.
+ This tool allows:
+ to connect SD card to DUT (Device Under Test) or to TS (Test Server)
+ to connect one USB port to DUT or TS
+ to power off or on DUT
+ to reset DUT through power disconnecting and reconnecting
+
+
+%prep
+%setup -q -n %{name}-%{version}
+
+%build
+cmake -DCMAKE_INSTALL_PREFIX=/usr
+%__make
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%files
+%{_bindir}/%{name}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..96d4cdc
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file src/CMakeLists.txt
+# @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
+#
+
+FIND_PACKAGE(PkgConfig)
+
+PKG_CHECK_MODULES(SDMUX_DEP
+ REQUIRED
+ libftdi1
+ popt
+ )
+
+SET(SDMUXCTRL_PATH
+ ${PROJECT_SOURCE_DIR}/src
+ )
+
+SET(SDMUXCTRL_SOURCES
+ ${SDMUXCTRL_PATH}/main.cpp
+ )
+
+INCLUDE_DIRECTORIES(
+ ${SDMUXCTRL_PATH}
+ ${FTD2XX_PATH}
+ )
+
+ADD_EXECUTABLE(${TARGET_SDMUXCTRL} ${SDMUXCTRL_SOURCES})
+
+TARGET_LINK_LIBRARIES(${TARGET_SDMUXCTRL}
+ ${SDMUX_DEP_LIBRARIES}
+ )
+
+INSTALL(TARGETS ${TARGET_SDMUXCTRL} DESTINATION ${BIN_INSTALL_DIR})
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..637a024
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+/**
+ * @file src/main.cpp
+ * @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
+ * @brief Main sd-mux-ctrl file
+ */
+
+
+int main(int argc, const char **argv) {
+ (void)argc;
+ (void)argv;
+
+ return 0;
+}