luxonis / depthai-core

DepthAI C++ Library
MIT License
235 stars 127 forks source link

`isUserBootloader()` fails to check conditions correctly #1102

Open diablodale opened 2 months ago

diablodale commented 2 months ago

depthai-core v2.27.0 isUserBootloader() fails to check conditions correctly.

I think the code needs to check what is flashed...not what is currently running since it could be running from an esoteric/embedded blob. Should also check that it is a NETWORK sensor not usb, so calling isUserBootloaderSupported() fits well.

https://github.com/luxonis/depthai-core/blob/729e478108f40d117ef7876b1360596f35645ddf/src/device/DeviceBootloader.cpp#L729-L733

I think that block should instead be

bool DeviceBootloader::isUserBootloader() const {
    // Check if bootloader version is adequate
    if(!isUserBootloaderSupported()) {
        return false;
    }