Codabar_Decode


Files

file  decode_codabar.c
 Codabar Decode.

Functions

unsigned short DecodeCodabar (struct BC_STRUCT *p)
 Codabar decode routine.

Function Documentation

unsigned short DecodeCodabar ( struct BC_STRUCT p  ) 

Codabar decode routine.

Parameters:
p points to channel context
Returns:
0 if unable to decode, else decoded character count

Definition at line 119 of file decode_codabar.c.

References BC_STRUCT::decode_count, BC_STRUCT::sample_buffer, BC_STRUCT::sample_ctr, and BC_STRUCT::sample_ptr.

00120 {
00121     // Minimum sample count
00122     if(p->sample_ctr < 21){
00123         return  0;
00124     }
00125 
00126     // Try to decode
00127     p->sample_ptr = &p->sample_buffer[0];
00128     if(FindStart(p) != NO_CODE){
00129         if(Decode(p) != NO_DECODE){
00130             return p->decode_count;
00131         }
00132     }
00133 
00134     // Unable to decode
00135     return 0;
00136 }

Download Source Code