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; }
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"); }