You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/01 17:49:01 UTC
(nuttx-apps) 08/09: system/uORB: return subscibe latency/interval
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit b0b4ac0f39f4432abb1374e4db32078c951e21cd
Author: dongjiuzhu1 <do...@xiaomi.com>
AuthorDate: Thu May 9 12:29:52 2024 +0800
system/uORB: return subscibe latency/interval
Signed-off-by: dongjiuzhu1 <do...@xiaomi.com>
---
system/uorb/uORB/uORB.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/system/uorb/uORB/uORB.c b/system/uorb/uORB/uORB.c
index 67bf6461b..09f611c1b 100644
--- a/system/uorb/uORB/uORB.c
+++ b/system/uorb/uORB/uORB.c
@@ -246,16 +246,16 @@ int orb_set_interval(int fd, unsigned interval)
int orb_get_interval(int fd, FAR unsigned *interval)
{
- struct sensor_state_s tmp;
+ struct sensor_ustate_s tmp;
int ret;
- ret = ioctl(fd, SNIOC_GET_STATE, (unsigned long)(uintptr_t)&tmp);
+ ret = ioctl(fd, SNIOC_GET_USTATE, (unsigned long)(uintptr_t)&tmp);
if (ret < 0)
{
return ret;
}
- *interval = tmp.min_interval;
+ *interval = tmp.interval;
return ret;
}
@@ -276,16 +276,16 @@ int orb_set_batch_interval(int fd, unsigned batch_interval)
int orb_get_batch_interval(int fd, FAR unsigned *batch_interval)
{
- struct sensor_state_s tmp;
+ struct sensor_ustate_s tmp;
int ret;
- ret = ioctl(fd, SNIOC_GET_STATE, (unsigned long)(uintptr_t)&tmp);
+ ret = ioctl(fd, SNIOC_GET_USTATE, (unsigned long)(uintptr_t)&tmp);
if (ret < 0)
{
return ret;
}
- *batch_interval = tmp.min_latency;
+ *batch_interval = tmp.latency;
return ret;
}
@@ -367,4 +367,4 @@ int orb_fprintf(FAR FILE *stream, FAR const char *format,
lib_stdoutstream(&stdoutstream, stream);
return lib_bsprintf(&stdoutstream.common, format, data);
}
-#endif
\ No newline at end of file
+#endif