* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include <string.h>
#include "protocol.h"
#define SERIALCOMM "9600/8n1"
/* 23ms is the longest interval between tokens. */
-#define MAX_SCAN_TIME 25 * 1000
+#define MAX_SCAN_TIME_US (25 * 1000)
static const uint32_t scanopts[] = {
SR_CONF_CONN,
return NULL;
devices = NULL;
- drvc = di->priv;
+ drvc = di->context;
start = g_get_monotonic_time();
- while (g_get_monotonic_time() - start < MAX_SCAN_TIME) {
+ while (g_get_monotonic_time() - start < MAX_SCAN_TIME_US) {
if (serial_read_nonblocking(serial, &c, 1) == 1 && c == 0xa5) {
/* Found one. */
sdi = g_malloc0(sizeof(struct sr_dev_inst));
static GSList *dev_list(const struct sr_dev_driver *di)
{
- return ((struct drv_context *)(di->priv))->instances;
+ return ((struct drv_context *)(di->context))->instances;
}
static int dev_open(struct sr_dev_inst *sdi)
case SR_CONF_DEVICE_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
+ break;
case SR_CONF_SPL_WEIGHT_FREQ:
*data = g_variant_new_strv(weight_freq, ARRAY_SIZE(weight_freq));
break;
.dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
- .priv = NULL,
+ .context = NULL,
};