Update and clean apps

This commit is contained in:
Willy-JL
2023-06-17 01:16:36 +01:00
parent cee49d59b4
commit a039e0216f
22 changed files with 286 additions and 502 deletions

View File

@@ -43,6 +43,14 @@ void init_types() {
code_128->start_pos = 0;
barcode_type_objs[CODE128] = code_128;
BarcodeTypeObj* codabar = malloc(sizeof(BarcodeTypeObj));
codabar->name = "Codabar";
codabar->type = CODABAR;
codabar->min_digits = 1;
codabar->max_digits = -1;
codabar->start_pos = 0;
barcode_type_objs[CODABAR] = codabar;
BarcodeTypeObj* unknown = malloc(sizeof(BarcodeTypeObj));
unknown->name = "Unknown";
unknown->type = UNKNOWN;
@@ -74,6 +82,9 @@ BarcodeTypeObj* get_type(FuriString* type_string) {
if(furi_string_cmp_str(type_string, "CODE-128") == 0) {
return barcode_type_objs[CODE128];
}
if(furi_string_cmp_str(type_string, "Codabar") == 0) {
return barcode_type_objs[CODABAR];
}
return barcode_type_objs[UNKNOWN];
}
@@ -98,7 +109,7 @@ const char* get_error_code_name(ErrorCode error_code) {
return "OK";
default:
return "Unknown Code";
}
};
}
const char* get_error_code_message(ErrorCode error_code) {
@@ -121,5 +132,5 @@ const char* get_error_code_message(ErrorCode error_code) {
return "OK";
default:
return "Could not read barcode data";
}
};
}