fuji-cam-wifi-tool: add master version

feature/hass
Ingolf Wagner 2020-03-11 16:29:21 +08:00
parent 58b24565ee
commit ed224c9a16
Signed by: palo
GPG Key ID: 76BF5F1928B9618B
4 changed files with 99 additions and 0 deletions

View File

@ -15,6 +15,9 @@ in {
# rust development environment
rustup
jetbrains.clion
# foto
fuji-cam-wifi-tool
];
environment.variables.RECIPE_HOME = "$HOME/mahlzeit";

View File

@ -26,6 +26,8 @@ in {
gitlog2json = callPackage ./gitlog2json { };
fuji-cam-wifi-tool = callPackage ./fuji-cam {};
bitwig-studio3 = callPackage ./bitwig-studio/bitwig-studio3.nix { };
bitwig-studio = callPackage ./bitwig-studio/bitwig-studio-environment.nix { };

28
pkgs/fuji-cam/default.nix Normal file
View File

@ -0,0 +1,28 @@
{ stdenv, fetchgit, fetchpatch, cmake, linenoise, opencv, ... }:
stdenv.mkDerivation rec {
version = "master";
name = "fuji-cam-wifi-tool-${version}";
src = fetchgit {
url = "https://github.com/hkr/fuji-cam-wifi-tool.git";
rev = "d66aad105f8533f62cf308647850c04f3436af26";
sha256 = "0bnqdqs7g1p5qz3jnlazydznym516bwwxsyzybqxqxy01jjpc5kw";
};
patches = [ ./my.patch ];
buildInputs = [ linenoise opencv ];
nativeBuildInputs = [ cmake ];
cmakeFlags = [ "-DWITH_OPENCV=ON" ];
meta = with stdenv.lib; {
description =
"Trying to reverse-engineer the wifi remote control protocol used by Fuji X series cameras";
homepage = "https://github.com/hkr/fuji-cam-wifi-tool";
license = licenses.unknown;
platforms = platforms.linux;
maintainers = with maintainers; [ mrVanDalo ];
};
}

66
pkgs/fuji-cam/my.patch Normal file
View File

@ -0,0 +1,66 @@
diff --git a/lib/include/capabilities.hpp b/lib/include/capabilities.hpp
index d8d05dc..46f3660 100644
--- a/lib/include/capabilities.hpp
+++ b/lib/include/capabilities.hpp
@@ -37,7 +37,7 @@ enum property_codes: uint16_t {
bool is_known_property(uint16_t value);
std::string to_string(property_codes property);
-enum data_type : uint16_t {
+enum data_types : uint16_t {
data_type_unknown = 0,
data_type_int8 = 1,
data_type_uint8 = 2,
@@ -47,7 +47,7 @@ enum data_type : uint16_t {
data_type_uint32 = 6
};
-inline bool is_signed(data_type dt)
+inline bool is_signed(data_types dt)
{
switch (dt) {
default:
@@ -59,7 +59,7 @@ inline bool is_signed(data_type dt)
}
}
-inline size_t data_type_size(data_type dt)
+inline size_t data_type_size(data_types dt)
{
switch (dt) {
case data_type_int8:
@@ -79,7 +79,7 @@ inline size_t data_type_size(data_type dt)
struct capability {
property_codes property_code = property_unknown;
- data_type data_type = data_type_unknown;
+ data_types data_type = data_type_unknown;
uint8_t get_set = 0;
uint32_t default_value = 0;
uint32_t current_value = 0;
diff --git a/lib/src/capabilities.cpp b/lib/src/capabilities.cpp
index 9f5b175..141d8fc 100644
--- a/lib/src/capabilities.cpp
+++ b/lib/src/capabilities.cpp
@@ -63,7 +63,7 @@ std::string to_string(property_codes property)
flag = "(current)"; \
printf("\t\t%s %s\n", value_string, flag.c_str())
-static int cap_value_to_int(data_type dt, uint32_t value)
+static int cap_value_to_int(data_types dt, uint32_t value)
{
switch (dt)
{
diff --git a/tool/CMakeLists.txt b/tool/CMakeLists.txt
index 74c15d6..3d221c9 100644
--- a/tool/CMakeLists.txt
+++ b/tool/CMakeLists.txt
@@ -30,3 +30,8 @@ endif()
if(WIN32)
target_link_libraries(fuji_cam_wifi_tool wsock32 ws2_32)
endif()
+
+
+# install
+install(TARGETS fuji_cam_wifi_tool DESTINATION bin)
+