/* Definitions */
/* Lengths of the different fixed-length codes */
#define CUECAT_DEVICE_ID_LEN    18
#define CUECAT_BARCODE_TYPE_LEN  3
#define CUECAT_BARCODE_SUBTYPE_LEN  1

/* Barcode decoder return codes */
#define BARCODE_DECODER_ERROR                 -1	/* Internal error */
#define NO_BARCODE_DECODING_IN_PROGRESS       0
#define POSSIBLE_BARCODE_DECODING_IN_PROGRESS 1
#define BARCODE_DECODED                       2 

/* Maximum number of scancodes sent by the cuecat in one transmission :
     ALT-F10 = 4 scancodes
   + '.'     = 2 scancodes
   + 6*4 capital letters (4 scancodes each)
   + '.'     = 2 scancodes
   + 4 capital letters (4 scancodes each)
   + '.'     = 2 scancodes
   + 12*4+3 capital letters (4 scancodes each)
   + '.'     = 2 scancodes
   + '\n'    = 2 scancodes
   = 330 scancodes

   NOTE : it has been measured that the longest barcode the CueCat can send is
          a CODE128-B of 19 characters (that can all be uppercase) or a
          CODE128-C of 38 digits. In the first case, 19 characters are coded on
          26 coded triplet characters, i.e. 4*26=104 scancodes if all of them
          are uppercase. In the second case, 38 digits are coded on 51 coded
          triplet characters, i.e. 4*51=204 scancodes if all of them are upper-
          case. So the longest barcode will be sent with 204 scancodes.
*/ 
#define CUECAT_MAX_SCANCODE_SEQUENCE 4+2+(6*4*4)+2+(4*4)+2+((12*4+3)*4)+2+2



/* Function prototypes */
void cuecat_reset_barcode_decoder(void);
char cuecat_decode_barcode(unsigned char scancode,
                           char *cuecat_id,
                           char *barcode_type,
                           char *barcode);
