mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-07-26 02:17:01 +08:00
system/uORB: return subscibe latency/interval
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
6c237cfbc0
commit
b0b4ac0f39
@ -246,16 +246,16 @@ int orb_set_interval(int fd, unsigned interval)
|
|||||||
|
|
||||||
int orb_get_interval(int fd, FAR unsigned *interval)
|
int orb_get_interval(int fd, FAR unsigned *interval)
|
||||||
{
|
{
|
||||||
struct sensor_state_s tmp;
|
struct sensor_ustate_s tmp;
|
||||||
int ret;
|
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)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
*interval = tmp.min_interval;
|
*interval = tmp.interval;
|
||||||
return ret;
|
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)
|
int orb_get_batch_interval(int fd, FAR unsigned *batch_interval)
|
||||||
{
|
{
|
||||||
struct sensor_state_s tmp;
|
struct sensor_ustate_s tmp;
|
||||||
int ret;
|
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)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
*batch_interval = tmp.min_latency;
|
*batch_interval = tmp.latency;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,4 +367,4 @@ int orb_fprintf(FAR FILE *stream, FAR const char *format,
|
|||||||
lib_stdoutstream(&stdoutstream, stream);
|
lib_stdoutstream(&stdoutstream, stream);
|
||||||
return lib_bsprintf(&stdoutstream.common, format, data);
|
return lib_bsprintf(&stdoutstream.common, format, data);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user