#include "config.h"
#include "protocol.h"
-
SR_PRIV struct sr_dev_driver driver_info;
static struct sr_dev_driver *di = &${lib}_driver_info;
-
/* Properly close and free all devices. */
static int clear_instances(void)
{
struct drv_context *drvc;
if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) {
- sr_err("${short}: driver context malloc failed.");
+ sr_err("${short}: Driver context malloc failed.");
return SR_ERR;
}
GSList *devices;
(void)options;
+
devices = NULL;
drvc = di->priv;
drvc->instances = NULL;
static int hw_dev_open(struct sr_dev_inst *sdi)
{
-
/* TODO */
return SR_OK;
static int hw_dev_close(struct sr_dev_inst *sdi)
{
-
/* TODO */
return SR_OK;
static int hw_cleanup(void)
{
-
clear_instances();
/* TODO */
}
static int hw_info_get(int info_id, const void **data,
- const struct sr_dev_inst *sdi)
+ const struct sr_dev_inst *sdi)
{
-
-
switch (info_id) {
/* TODO */
default:
}
static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
- const void *value)
+ const void *value)
{
int ret;
}
static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+ void *cb_data)
{
-
/* TODO */
return SR_OK;
}
static int hw_dev_acquisition_stop(const struct sr_dev_inst *sdi,
- void *cb_data)
+ void *cb_data)
{
-
(void)cb_data;
if (sdi->status != SR_ST_ACTIVE)
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <stdlib.h>
#include <glib.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
#include "config.h"
#include "protocol.h"
-#include <stdlib.h>
-
SR_PRIV int ${lib}_receive_data(int fd, int revents, void *cb_data)
{
return TRUE;
if (revents == G_IO_IN) {
- /* TODO */
+ /* TODO */
}
return TRUE;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
#ifndef LIBSIGROK_${upper}_H
#define LIBSIGROK_${upper}_H
-/* Private, per-device-instance driver context. */
+/** Private, per-device-instance driver context. */
struct dev_context {
+ /** The current sampling limit (in number of samples). */
uint64_t limit_samples;
+
+ /** The current sampling limit (in ms). */
uint64_t limit_msec;
- /* Opaque pointer passed in by the frontend. */
+ /** Opaque pointer passed in by the frontend. */
void *cb_data;
- /* Runtime. */
+ /** The current number of already received samples. */
uint64_t num_samples;
};