Skip to content

Commit

Permalink
fix manufacture data all zero
Browse files Browse the repository at this point in the history
  • Loading branch information
tyano463 authored and oliviermartin committed May 30, 2024
1 parent 0d2d629 commit fec9499
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions dbus/gattlib_advertisement.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,12 @@ int get_advertisement_data_from_device(OrgBluezDevice1 *bluez_device1,
}

// Copy manufacturer data to structure
GVariant* value;
g_variant_get(values, "ay", &iter);
size_t index = 0;
for (unsigned int j = 0; j < (*manufacturer_data)[i].data_size; j++)
{
GVariant *v = g_variant_get_child_value(values, j);

while ((value = g_variant_iter_next_value(iter)) != NULL) {
g_variant_get(value, "y", (*manufacturer_data)[i].data[index++]);
g_variant_unref(value);
(*manufacturer_data)[i].data[j] = g_variant_get_byte(v);
}
g_variant_iter_free(iter);
}
}

Expand Down

0 comments on commit fec9499

Please sign in to comment.