mirror of https://github.com/labapart/gattlib
bluez: Minor coding style change
parent
2d81b253da
commit
120f6e0886
|
@ -149,17 +149,17 @@ int gattlib_discover_char_range(gatt_connection_t* connection, int start, int en
|
|||
bzero(&user_data, sizeof(user_data));
|
||||
user_data.discovered = FALSE;
|
||||
|
||||
gattlib_context_t* conn_context = connection->context;
|
||||
gattlib_context_t* conn_context = connection->context;
|
||||
ret = gatt_discover_char(conn_context->attrib, start, end, NULL, characteristic_cb, &user_data);
|
||||
if (ret == 0) {
|
||||
fprintf(stderr, "Fail to discover characteristics.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Wait for completion
|
||||
// Wait for completion
|
||||
while(user_data.discovered == FALSE) {
|
||||
g_main_context_iteration(g_gattlib_thread.loop_context, FALSE);
|
||||
}
|
||||
}
|
||||
*characteristics = user_data.characteristics;
|
||||
*characteristics_count = user_data.characteristics_count;
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ int gattlib_write_char_by_handle(gatt_connection_t* connection, uint16_t handle,
|
|||
int write_completed = FALSE;
|
||||
|
||||
guint ret = gatt_write_char(conn_context->attrib, handle, (void*)buffer, buffer_len,
|
||||
gattlib_write_result_cb, &write_completed);
|
||||
gattlib_write_result_cb, &write_completed);
|
||||
if (ret == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ int gattlib_write_char_by_handle(gatt_connection_t* connection, uint16_t handle,
|
|||
// Wait for completion of the event
|
||||
while(write_completed == FALSE) {
|
||||
g_main_context_iteration(g_gattlib_thread.loop_context, FALSE);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue