This is an automated email from the ASF dual-hosted git repository.

lupyuen pushed a commit to branch releases/12.7
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 84e7a1d409bfe61327578895de5f0f58cfa87e53
Author: dongjiuzhu1 <dongjiuz...@xiaomi.com>
AuthorDate: Thu May 9 12:29:52 2024 +0800

    system/uORB: return subscibe latency/interval
    
    Signed-off-by: dongjiuzhu1 <dongjiuz...@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

Reply via email to