system/uORB: return subscibe latency/interval
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
9d7e023e65
commit
84e7a1d409
@ -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…
x
Reference in New Issue
Block a user