示例#1
0
static void
dump_devices (void)
{
	BluetoothClient *client;
	GtkTreeModel *model;
	GtkTreeIter iter;

	client = bluetooth_client_new ();
	model = bluetooth_client_get_model (client);

	if (gtk_tree_model_get_iter_first (model, &iter) == FALSE) {
		g_print ("No known devices\n");
		g_print ("Is bluetoothd running, and a Bluetooth adapter enabled?\n");
		return;
	}
	bluetooth_client_dump_device (model, &iter, TRUE);
	while (gtk_tree_model_iter_next (model, &iter))
		bluetooth_client_dump_device (model, &iter, TRUE);
}
示例#2
0
/**
 * bluetooth_chooser_dump_selected_device:
 * @self: A #BluetoothChooser widget.
 *
 * Prints all the known attributes for the currently selected device
 * on the standard output. Useful for debugging.
 **/
void
bluetooth_chooser_dump_selected_device (BluetoothChooser *self)
{
	BluetoothChooserPrivate *priv = BLUETOOTH_CHOOSER_GET_PRIVATE(self);
	GtkTreeIter iter;
	GtkTreeModel *model;

	gtk_tree_selection_get_selected (priv->selection, &model, &iter);

	bluetooth_client_dump_device (model, &iter);
}