예제 #1
0
파일: main.c 프로젝트: richardxu/panda-a4
static int input_init(void)
{
	GKeyFile *config;

	connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
	if (connection == NULL)
		return -EIO;

	config = load_config_file(CONFIGDIR "/input.conf");

	if (input_manager_init(connection, config) < 0) {
		dbus_connection_unref(connection);
		return -EIO;
	}

	if (hog_init() < 0) {
		dbus_connection_unref(connection);
		return -EIO;
	}

	if (config)
		g_key_file_free(config);

	return 0;
}
예제 #2
0
파일: main.c 프로젝트: bigdinotech/zephyr
static void bt_ready(int err)
{
	if (err) {
		printk("Bluetooth init failed (err %d)\n", err);
		return;
	}

	printk("Bluetooth initialized\n");

	gap_init(DEVICE_NAME, HOG_APPEARANCE);
	bas_init();
	dis_init(CONFIG_SOC, "Manufacturer");
	hog_init();

	err = bt_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad),
			      sd, ARRAY_SIZE(sd));
	if (err) {
		printk("Advertising failed to start (err %d)\n", err);
		return;
	}

	printk("Advertising successfully started\n");
}