Scanner setEnable function takes too long seconds

I developing product apps with flutter and kotlin. In my algorithm i want to close scanner before process and then open. I can closing superfast but when i call setEnabled(true) it takes 1-2 seconds

Hello @Gorkem_Ozdemir

Would you provide some more info on the context please? On which class are you calling the setEnabled() mehtod? Are you trying to to enable the Wedge, or one of the triggers, or a scanner’s parameter?

For more reference on how to enable/disable the Scan Engine on Datalogic devices, see also this article:

Regards
Simone Callegari

1 Like

I realized that the delay I mentioned in my question was due to turning on all the triggers on the device. Delay was resolved by just turning on the trigger used.

I’m sharing it to help others
First code →
for (trigger in keyManager.availableTriggers) {
trigger.setEnabled(true)
}

Last code →

    val lt: List<Trigger> = keyManager.getAvailableTriggers()
    for (tr: Trigger in lt) {
        if (tr.getId() == KeyboardManager.TRIGGER_ID_FRONT) {
            tr.setEnabled(true);

        }
    }
}

Thank you for answer :slight_smile:

1 Like

Depending on the architecture of the application, to control the activation of the ScanEngine, also consider registering/releasing all decoding listeners (see method 1 mentioned in the previous article). In some cases it could be more convenient.

Simone Callegari
Datalogic Mobile Products Specialist - L3 SW Engineer