// Autogenerated C header file for Barcode reader
#ifndef _JACDAC_SPEC_BARCODE_READER_H
#define _JACDAC_SPEC_BARCODE_READER_H 1

#define JD_SERVICE_CLASS_BARCODE_READER  0x1c739e6c

// enum Format (uint8_t)
#define JD_BARCODE_READER_FORMAT_AZTEC 0x1
#define JD_BARCODE_READER_FORMAT_CODE128 0x2
#define JD_BARCODE_READER_FORMAT_CODE39 0x3
#define JD_BARCODE_READER_FORMAT_CODE93 0x4
#define JD_BARCODE_READER_FORMAT_CODABAR 0x5
#define JD_BARCODE_READER_FORMAT_DATA_MATRIX 0x6
#define JD_BARCODE_READER_FORMAT_EAN13 0x8
#define JD_BARCODE_READER_FORMAT_EAN8 0x9
#define JD_BARCODE_READER_FORMAT_ITF 0xa
#define JD_BARCODE_READER_FORMAT_PDF417 0xb
#define JD_BARCODE_READER_FORMAT_QR_CODE 0xc
#define JD_BARCODE_READER_FORMAT_UPC_A 0xd
#define JD_BARCODE_READER_FORMAT_UPC_E 0xe

/**
 * Read-write bool (uint8_t). Turns on or off the detection of barcodes.
 */
#define JD_BARCODE_READER_REG_ENABLED JD_REG_INTENSITY

/**
 * Constant. Reports the list of supported barcode formats, as documented in https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detection_API.
 */
#define JD_BARCODE_READER_REG_FORMATS 0x180
typedef struct jd_barcode_reader_formats {
    uint8_t format[0];  // Format
} jd_barcode_reader_formats_t;


/**
 * Raised when a bar code is detected and decoded. If the reader detects multiple codes, it will issue multiple events.
 * In case of numeric barcodes, the `data` field should contain the ASCII (which is the same as UTF8 in that case) representation of the number.
 */
#define JD_BARCODE_READER_EV_DETECT JD_EV_ACTIVE
typedef struct jd_barcode_reader_detect {
    uint8_t format;  // Format
    char data[0];  // string
} jd_barcode_reader_detect_t;


#endif
