- /* Send data packets to the session bus. */
- sr_dbg("%s: sending SR_DF_LOGIC data packets", __func__);
- packet.type = SR_DF_LOGIC;
- packet.payload = &logic;
- logic.unitsize = (num_channels + 7) / 8;
- logic.data = buf;
-
- /* Send 8MB of total data to the session bus in small chunks. */
- for (i = 0; i < NUM_PACKETS; i++) {
- /* TODO: Handle errors, handle incomplete reads. */
- size = read(fd, buf, PACKET_SIZE);
- logic.length = size;
- sr_session_send(in->sdi, &packet);
- }
- close(fd); /* FIXME */