+static void srd_cb_bin(struct srd_proto_data *pdata, void *cb_data)
+{
+ struct srd_proto_data_binary *pdb;
+ struct output *op;
+
+ op = cb_data;
+ if (op->type != SRD_OUTPUT_BINARY)
+ return;
+
+ DBG("Binary output from %s", pdata->pdo->di->inst_id);
+ pdb = pdata->data;
+
+ if (strcmp(pdata->pdo->di->inst_id, op->pd))
+ /* This is not the PD selected for output. */
+ return;
+
+ if (op->class_idx != -1 && op->class_idx != pdb->bin_class)
+ /*
+ * This output takes a specific binary class,
+ * but not the one that just came in.
+ */
+ return;
+
+ if (write(op->outfd, pdb->data, pdb->size) == -1)
+ ERR("Oops!");
+
+}
+