while (sent < n) {
tosend = MIN(2048, n - sent);
- packet.type = DF_LOGIC16;
+ packet.type = DF_LOGIC;
packet.length = tosend * sizeof(uint16_t);
+ packet.unitsize = 2;
packet.payload = samples + sent;
session_bus(user_data, &packet);
&trigger);
if (tosend > 0) {
- packet.type = DF_LOGIC16;
+ packet.type = DF_LOGIC;
packet.length = tosend * sizeof(uint16_t);
+ packet.unitsize = 2;
packet.payload = samples;
session_bus(user_data, &packet);
/* Send rest of the chunk to sigrok. */
tosend = n - sent;
- packet.type = DF_LOGIC16;
+ packet.type = DF_LOGIC;
packet.length = tosend * sizeof(uint16_t);
+ packet.unitsize = 2;
packet.payload = samples + sent;
session_bus(user_data, &packet);
z = read(fd, &c, BUFSIZE);
if (z > 0) {
- packet.type = DF_LOGIC8;
+ packet.type = DF_LOGIC;
packet.length = z;
+ packet.unitsize = 1;
packet.payload = c;
session_bus(user_data, &packet);
}
*/
if (trigger_at > 0) {
/* there are pre-trigger samples, send those first */
- packet.type = DF_LOGIC32;
+ packet.type = DF_LOGIC;
packet.length = trigger_at * 4;
+ packet.unitsize = 4;
packet.payload = raw_sample_buf;
session_bus(user_data, &packet);
}
packet.length = 0;
session_bus(user_data, &packet);
- packet.type = DF_LOGIC32;
+ packet.type = DF_LOGIC;
packet.length = (limit_samples * 4) - (trigger_at * 4);
+ packet.unitsize = 4;
packet.payload = raw_sample_buf + trigger_at * 4;
session_bus(user_data, &packet);
} else {
- packet.type = DF_LOGIC32;
+ packet.type = DF_LOGIC;
packet.length = limit_samples * 4;
+ packet.unitsize = 4;
packet.payload = raw_sample_buf;
session_bus(user_data, &packet);
}
* Send the samples that triggered it, since we're
* skipping past them.
*/
- packet.type = DF_LOGIC8;
+ packet.type = DF_LOGIC;
packet.length = trigger_stage;
+ packet.unitsize = 1;
packet.payload = trigger_buffer;
session_bus(user_data, &packet);
if (trigger_stage == TRIGGER_FIRED) {
/* Send the incoming transfer to the session bus. */
- packet.type = DF_LOGIC8;
+ packet.type = DF_LOGIC;
packet.length = cur_buflen - trigger_offset;
+ packet.unitsize = 1;
packet.payload = cur_buf + trigger_offset;
session_bus(user_data, &packet);
g_free(cur_buf);
PACKET_SIZE, res);
#endif
- packet.type = DF_LOGIC32;
+ packet.type = DF_LOGIC;
packet.length = PACKET_SIZE;
+ packet.unitsize = 4;
packet.payload = buf;
session_bus(session_device_id, &packet);
}
packet.payload = &header;
session_bus(device, &packet);
- packet.type = DF_LOGIC8;
+ packet.type = DF_LOGIC;
+ packet.unitsize = 1;
packet.payload = buffer;
while ((size = read(fd, buffer, CHUNKSIZE)) > 0) {
packet.length = size;
DF_HEADER,
DF_END,
DF_TRIGGER,
- DF_LOGIC8,
- DF_LOGIC16,
- DF_LOGIC24,
- DF_LOGIC32,
- DF_LOGIC48,
- DF_LOGIC64,
+ DF_LOGIC,
+ DF_PD,
+ DF_PA,
};
struct datafeed_packet {
uint16_t type;
uint64_t length;
+ uint16_t unitsize;
void *payload;
};