/* size of chunks to send through the session bus */
#define BUFSIZE 4096
-
enum {
GENMODE_RANDOM,
GENMODE_INC,
HWCAP_CONTINUOUS
};
-static char *patternmodes[] = {
+static const char *patternmodes[] = {
"random",
"incremental",
- NULL
+ NULL,
};
/* List of struct sigrok_device_instance, maintained by opendev()/closedev(). */
static uint64_t limit_samples = -1;
static int default_genmode = GENMODE_RANDOM;
-
static void hw_stop_acquisition(int device_index, gpointer session_device_id);
static int hw_init(char *deviceinfo)
static int *hw_get_capabilities(void)
{
-
return capabilities;
}
device_index = device_index;
if (capability == HWCAP_PROBECONFIG) {
- /* nothing to do */
+ /* Nothing to do. */
ret = SIGROK_OK;
} else if (capability == HWCAP_LIMIT_SAMPLES) {
tmp_u64 = value;
if (limit_samples)
nb_to_send = limit_samples - mydata->samples_counter;
else
- nb_to_send = BUFSIZE; // CONTINUOUS MODE
+ nb_to_send = BUFSIZE; /* Continuous mode */
if (nb_to_send == 0) {
close(mydata->pipe_fds[1]);
static int receive_data(int fd, int revents, void *user_data)
{
struct datafeed_packet packet;
- /* uint16_t samples[1000]; */
char c[BUFSIZE];
uint64_t z;
/* Send last packet. */
packet.type = DF_END;
session_bus(session_device_id, &packet);
-
}
struct device_plugin demo_plugin_info = {