diff --git a/README.md b/README.md index ecd8a78ca..405102cc0 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,7 @@ The following environment variables can be set to alter default behavior of the | DEPTHAI_BOOTLOADER_BINARY_USB | Overrides device USB Bootloader binary. Mostly for internal debugging purposes. | | DEPTHAI_BOOTLOADER_BINARY_ETH | Overrides device Network Bootloader binary. Mostly for internal debugging purposes. | | DEPTHAI_ALLOW_FACTORY_FLASHING | Internal use only | +| DEPTHAI_LIBUSB_ANDROID_JAVAVM | JavaVM pointer that is passed to libusb for rootless Android interaction with devices. Interpreted as decimal value of uintptr_t | ## Running tests diff --git a/cmake/Hunter/config.cmake b/cmake/Hunter/config.cmake index 8b1ec7984..500421c97 100644 --- a/cmake/Hunter/config.cmake +++ b/cmake/Hunter/config.cmake @@ -8,8 +8,8 @@ hunter_config( hunter_config( XLink VERSION "luxonis-2021.4.2-develop" - URL "https://github.com/luxonis/XLink/archive/c940feaf9321f06a7d9660f28e686a9718135f38.tar.gz" - SHA1 "52935b6ceb470ee632de3348b9d2aaa2c6c24ac0" + URL "https://github.com/luxonis/XLink/archive/6862ec0e5f82efb1148a0b0a21486aaf9831451c.tar.gz" + SHA1 "450614ab33425b34a62d9de6d65441d95d708710" CMAKE_ARGS XLINK_ENABLE_LIBUSB=${DEPTHAI_ENABLE_LIBUSB} ) diff --git a/src/utility/Initialization.cpp b/src/utility/Initialization.cpp index 5225ed6aa..7ed63fad1 100644 --- a/src/utility/Initialization.cpp +++ b/src/utility/Initialization.cpp @@ -78,6 +78,15 @@ bool initialize(const char* additionalInfo, bool installSignalHandler, void* jav (void)installSignalHandler; #endif + // Read JavaVM pointer from env if present + { + auto javavmEnvStr = utility::getEnv("DEPTHAI_LIBUSB_ANDROID_JAVAVM"); + if(javavm == nullptr && !javavmEnvStr.empty()) { + // Read the uintptr_t value from the decimal string + sscanf(javavmEnvStr.c_str(), "%" SCNuPTR, reinterpret_cast(&javavm)); + } + } + // Print core commit and build datetime if(additionalInfo != nullptr && additionalInfo[0] != '\0') { logger::debug("{}", additionalInfo);