fet_db: some msg28 bytes matter more than others.

This commit is contained in:
Daniel Beer 2010-09-06 15:31:52 +12:00
parent 28923bf997
commit 08e13f7093
1 changed files with 7 additions and 1 deletions

View File

@ -785,12 +785,18 @@ const struct fet_db_record *fet_db_find_by_msg28(uint8_t *data, int len)
if (r->msg28_data[0] == data[0] &&
r->msg28_data[1] == data[1]) {
const static int coefficients[FET_DB_MSG28_LEN] = {
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 0, 0, 1, 1, 1, 1,
10, 1
};
int score = 0;
int j;
for (j = 0; j < len; j++)
if (r->msg28_data[j] == data[j])
score++;
score += coefficients[j];
if (best < 0 || score > best_score) {
best = i;