0

I use successfully the ZBarSDK in my iPhone application. The only problem is: sometime the scanner cannot read the barcode. I don't find how to set a timeout (if the code bar cannot be read for 5 second, abort scanning).

Is there a hidden option? Or a trick?

Thanks in advance for your help.

Jarekczek
  • 7,456
  • 3
  • 46
  • 66

1 Answers1

0

@le_jax The ZBarSDk is configured to a particular set of symbols as stated here

"ZBar is an open source software suite for reading bar codes from various sources, such as video streams, image files and raw intensity sensors. It supports many popular symbologies (types of bar codes) including EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code."

You can take use of a web resource such as this to test the functionality of your application.

What you have queried here points as of either You have not set desired symbology

[scanner setSymbology: ZBAR_I25 config: ZBAR_CFG_ENABLE to: 0];

or something related to configurational settings. You can check for the complete set of supported symbology from zbar.h (part of ZBar SDK).

typedef enum zbar_symbol_type_e {
    ZBAR_NONE        =      0,  /**< no symbol decoded */
    ZBAR_PARTIAL     =      1,  /**< intermediate status */
    ZBAR_EAN2        =      2,  /**< GS1 2-digit add-on */
    ZBAR_EAN5        =      5,  /**< GS1 5-digit add-on */
    ZBAR_EAN8        =      8,  /**< EAN-8 */
    ZBAR_UPCE        =      9,  /**< UPC-E */
    ZBAR_ISBN10      =     10,  /**< ISBN-10 (from EAN-13). @since 0.4 */
    ZBAR_UPCA        =     12,  /**< UPC-A */
    ZBAR_EAN13       =     13,  /**< EAN-13 */
    ZBAR_ISBN13      =     14,  /**< ISBN-13 (from EAN-13). @since 0.4 */
    ZBAR_COMPOSITE   =     15,  /**< EAN/UPC composite */
    ZBAR_I25         =     25,  /**< Interleaved 2 of 5. @since 0.4 */
    ZBAR_DATABAR     =     34,  /**< GS1 DataBar (RSS). @since 0.11 */
    ZBAR_DATABAR_EXP =     35,  /**< GS1 DataBar Expanded. @since 0.11 */
    ZBAR_CODE39      =     39,  /**< Code 39. @since 0.4 */
    ZBAR_PDF417      =     57,  /**< PDF417. @since 0.6 */
    ZBAR_QRCODE      =     64,  /**< QR Code. @since 0.10 */
    ZBAR_CODE93      =     93,  /**< Code 93. @since 0.11 */
    ZBAR_CODE128     =    128,  /**< Code 128 */

    /** mask for base symbol type.
     * @deprecated in 0.11, remove this from existing code
     */
    ZBAR_SYMBOL      = 0x00ff,
    /** 2-digit add-on flag.
     * @deprecated in 0.11, a ::ZBAR_EAN2 component is used for
     * 2-digit GS1 add-ons
     */
    ZBAR_ADDON2      = 0x0200,
    /** 5-digit add-on flag.
     * @deprecated in 0.11, a ::ZBAR_EAN5 component is used for
     * 5-digit GS1 add-ons
     */
    ZBAR_ADDON5      = 0x0500,
    /** add-on flag mask.
     * @deprecated in 0.11, GS1 add-ons are represented using composite
     * symbols of type ::ZBAR_COMPOSITE; add-on components use ::ZBAR_EAN2
     * or ::ZBAR_EAN5
     */
    ZBAR_ADDON       = 0x0700,
} zbar_symbol_type_t;

I am not quite sure if there is anything such as time out period to check if ZBar is not able to deccode the symbol but yes for sure you have the delegate method to make use of

- (void) readerView: (ZBarReaderView*) readerView didReadSymbols: (ZBarSymbolSet*) symbols
          fromImage: (UIImage*) image;

What I can suggest (the issue I faced earlier in which I could not scan the code second time I came on the scanner screen) is you can reconfigure the SDK following the examples provided in the SDK or you can confirm the Supported symbols (In case you are trying to decode some unsupported format).

In case you come across any standard approach to set the time out period, Please do share on SO.

Cheers!!

Community
  • 1
  • 1
Rahul Sharma
  • 3,013
  • 1
  • 20
  • 47
  • Thanks for your answer. My problem is not "the code is not recongnized or not the symbol I want to read" but "the code is to bad printed to event read it, stop trying, I will input it by hand". But manual intervention since the best way. –  Nov 05 '12 at 21:05