fix(sensortest): move set_interval and batch before activate.
modify coding style err.
@@ -273,37 +273,37 @@ int main(int argc, FAR char *argv[])
goto open_err;
}
- ret = ioctl(fd, SNIOC_ACTIVATE, 1);
+ ret = ioctl(fd, SNIOC_SET_INTERVAL, &interval);
if (ret < 0)
{
ret = -errno;
if (ret != -ENOTTY)
{
- printf("Failed to enable sensor:%s, ret:%s\n",
+ printf("Failed to set interval for sensor:%s, ret:%s\n",
devname, strerror(errno));
goto ctl_err;
}
}
- ret = ioctl(fd, SNIOC_SET_INTERVAL, &interval);
+ ret = ioctl(fd, SNIOC_BATCH, &latency);
if (ret < 0)
{
ret = -errno;
if (ret != -ENOTTY)
{
- printf("Failed to set interval for sensor:%s, ret:%s\n",
+ printf("Failed to batch for sensor:%s, ret:%s\n",
devname, strerror(errno));
goto ctl_err;
}
}
- ret = ioctl(fd, SNIOC_BATCH, &latency);
+ ret = ioctl(fd, SNIOC_ACTIVATE, 1);
if (ret < 0)
{
ret = -errno;
if (ret != -ENOTTY)
{
- printf("Failed to batch for sensor:%s, ret:%s\n",
+ printf("Failed to enable sensor:%s, ret:%s\n",
devname, strerror(errno));
goto ctl_err;
}
