newtek_ivga_consumer()
    {
        if (!airsend::is_available()) {
            CASPAR_THROW_EXCEPTION(not_supported() << msg_info(airsend::dll_name() + L" not available"));
        }

        graph_->set_text(print());
        graph_->set_color("frame-time", diagnostics::color(0.5f, 1.0f, 0.2f));
        graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f));
        graph_->set_color("dropped-frame", diagnostics::color(0.3f, 0.6f, 0.3f));
        diagnostics::register_graph(graph_);
    }
Ejemplo n.º 2
0
static DBusMessage *input_device_connect(DBusConnection *conn,
					DBusMessage *msg, void *data)
{
	struct input_device *idev = data;
	struct input_conn *iconn;
	struct fake_input *fake;
	DBusMessage *reply;
	GError *err = NULL;

	iconn = find_connection(idev->connections, "HID");
	if (!iconn)
		return not_supported(msg);

	if (iconn->pending_connect)
		return in_progress(msg);

	if (is_connected(iconn))
		return already_connected(msg);

	iconn->pending_connect = dbus_message_ref(msg);
	fake = iconn->fake;

	if (fake) {
		/* Fake input device */
		if (fake->connect(iconn, &err))
			fake->flags |= FI_FLAG_CONNECTED;
	} else {
		/* HID devices */
		GIOChannel *io;

		io = bt_io_connect(BT_IO_L2CAP, control_connect_cb, iconn,
					NULL, &err,
					BT_IO_OPT_SOURCE_BDADDR, &idev->src,
					BT_IO_OPT_DEST_BDADDR, &idev->dst,
					BT_IO_OPT_PSM, L2CAP_PSM_HIDP_CTRL,
					BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW,
					BT_IO_OPT_INVALID);
		iconn->ctrl_io = io;
	}

	if (err == NULL)
		return NULL;

	error("%s", err->message);
	dbus_message_unref(iconn->pending_connect);
	iconn->pending_connect = NULL;
	reply = connection_attempt_failed(msg, err->message);
	g_error_free(err);
	return reply;
}
Ejemplo n.º 3
0
 engine_entry get_engine_null_entry()
 {
   return engine_entry(
       [](const data::config& config_, const boost::filesystem::path&,
          const boost::filesystem::path&, const boost::filesystem::path&,
          iface::environment_detector&, iface::displayer&, logger*) {
         return make_engine(config_.active_shell_config().engine,
                            not_supported(), not_supported(), not_supported(),
                            not_supported(), not_supported(), not_supported(),
                            not_supported(), not_supported(),
                            supported_features());
       },
       "", data::markdown_string("An engine which does not support anything. "
                                 "Mainly for testing purposes."),
       supported_features());
 }
Ejemplo n.º 4
0
// Returns true if input is not a dheluks string
bool not_dheluks(unsigned char *str) {

	if (strlen((char *)str) < DHELUKS_STR_MIN_SIZE) //must be at least min size
		return true;

	if (not_equal(str, HEADER, HEADER_LEN, "Dheluks header not found"))
		return true; //first HEADER_LEN chars must be header

	if (not_supported(str[VSN_POSITION])) //must be a supported version
		return true;

	if (str[VSN_POSITION] == '0' && not_formatted(str+HEADER_LEN))
		return true; //must have formatting according to version spec

	return false;

}
Ejemplo n.º 5
0
 engine_entry get_engine_null_entry()
 {
   return engine_entry(
       [](const data::config& config_, const boost::filesystem::path&,
          const boost::filesystem::path&, const boost::filesystem::path&,
          iface::environment_detector&, iface::displayer&, logger*) {
         return make_engine(config_.engine, not_supported(), not_supported(),
                            not_supported(), not_supported(), not_supported(),
                            not_supported());
       },
       "",
       "An engine which does not support anything. Mainly for testing "
       "purposes.");
 }
Ejemplo n.º 6
0
struct symbol *gen_para_regs (struct symbol *parameters)
{
	char *registers[6] = {"rdi", "rsi", "rdx", "rcx", "r8", "r9"};
	int i=0;
	struct symbol *para_start = parameters;

	while (parameters != NULL) {
		if (i > 5) {
			not_supported ("more than 6 function parameters\n");
		}
		parameters->reg = strdup (registers[i++]);
		parameters = parameters->next;
	}

	#ifdef MY_DEBUG
	printf ("#-- ASSIGNING PARAMETER REGISTERS\n");
	table_print (para_start);
	printf ("\n");
	#endif

	return para_start;
}
Ejemplo n.º 7
0
static DBusMessage *session_get_capabilities(DBusConnection *connection,
					DBusMessage *message, void *user_data)
{
	return not_supported(message);
}
Ejemplo n.º 8
0
static DBusMessage *create_connection(DBusConnection *conn,
						DBusMessage *msg, void *data)
{
	struct pending_reply *pr;
	const char *addr;
	const char *str;
	bdaddr_t src;
	uint16_t id;
	int dev_id, err;
	char key[32];
	GSList *l;
	uuid_t uuid;

	if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &addr,
			DBUS_TYPE_STRING, &str, DBUS_TYPE_INVALID) == FALSE)
		return NULL;

	id = bnep_service_id(str);
	if (id != BNEP_SVC_GN && id != BNEP_SVC_NAP && id != BNEP_SVC_PANU)
		return not_supported(msg);

	snprintf(key, 32, "%s#%s", addr, bnep_name(id));

	/* Checks if the connection was already been made */
	for (l = connection_paths; l; l = l->next) {
		if (connection_find_data(l->data, key) == 0)
			return already_exists(msg);
	}

	bacpy(&src, BDADDR_ANY);
	dev_id = hci_get_route(&src);
	if (dev_id < 0 || hci_devba(dev_id, &src) < 0)
		return adapter_not_available(msg);

	pr = g_new0(struct pending_reply, 1);

	/* FIXME just to maintain compatibility */
	pr->adapter_path = g_strdup_printf("/org/bluez/hci%d", dev_id);
	if (!pr->adapter_path) {
		pending_reply_free (pr);
		return adapter_not_available(msg);
	}

	pr->conn = dbus_connection_ref(conn);
	pr->msg = dbus_message_ref(msg);
	bacpy(&pr->src, &src);
	str2ba(addr, &pr->dst);
	pr->addr = g_strdup(addr);
	pr->id = id;
	pr->path = g_new0(char, MAX_PATH_LENGTH);
	snprintf(pr->path, MAX_PATH_LENGTH,
				NETWORK_PATH "/connection%d", net_uid++);

	sdp_uuid16_create(&uuid, pr->id);
	err = bt_search_service(&pr->src, &pr->dst, &uuid, records_cb, pr,
				NULL);
	if (err < 0) {
		pending_reply_free(pr);
		return not_supported(msg);
	}

	return NULL;
}