Skip to content

Commit

Permalink
TODO: RemoveMe
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviermartin committed Apr 8, 2024
1 parent 5f72973 commit 5379064
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dbus/gattlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,8 @@ static void add_characteristics_from_service(struct _gattlib_connection_backend*
continue;
}

printf("- count %d with characteristic %s\n", *count, object_path);

characteristic_list[*count].handle = handle;
characteristic_list[*count].value_handle = handle;
characteristic_list[*count].properties = 0;
Expand Down Expand Up @@ -981,7 +983,9 @@ int gattlib_discover_char_range(gattlib_connection_t* connection, uint16_t start
g_object_unref(interface);

count_max++;
printf("- count_max %d with %s\n", count_max, object_path);
}
printf("count_max:%d\n", count_max);

gattlib_characteristic_t* characteristic_list = calloc(count_max * sizeof(gattlib_characteristic_t), 1);
if (characteristic_list == NULL) {
Expand All @@ -995,7 +999,7 @@ int gattlib_discover_char_range(gattlib_connection_t* connection, uint16_t start
const char* object_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));

GDBusInterface *interface = g_dbus_object_manager_get_interface(device_manager, object_path, "org.bluez.GattService1");
if (!interface) {
if (interface != NULL) {
// Check if this DBUS Path is actually the Battery interface. In this case,
// we add a fake characteristic for the battery.
interface = g_dbus_object_manager_get_interface(device_manager, object_path, "org.bluez.Battery1");
Expand All @@ -1010,6 +1014,7 @@ int gattlib_discover_char_range(gattlib_connection_t* connection, uint16_t start
"00002a19-0000-1000-8000-00805f9b34fb",
MAX_LEN_UUID_STR + 1,
&characteristic_list[count].uuid);
printf("- count with (battery) %s\n", object_path);
count++;
}

Expand Down

0 comments on commit 5379064

Please sign in to comment.