mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-10 23:15:18 +00:00
system/uORB: return subscibe latency/interval
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
6c237cfbc0
commit
b0b4ac0f39
1 changed files with 7 additions and 7 deletions
|
|
@ -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
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue