Skip to content

Commit b0b4ac0

Browse files
Donny9xiaoxiang781216
authored andcommitted
system/uORB: return subscibe latency/interval
Signed-off-by: dongjiuzhu1 <[email protected]>
1 parent 6c237cf commit b0b4ac0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

system/uorb/uORB/uORB.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,16 @@ int orb_set_interval(int fd, unsigned interval)
246246

247247
int orb_get_interval(int fd, FAR unsigned *interval)
248248
{
249-
struct sensor_state_s tmp;
249+
struct sensor_ustate_s tmp;
250250
int ret;
251251

252-
ret = ioctl(fd, SNIOC_GET_STATE, (unsigned long)(uintptr_t)&tmp);
252+
ret = ioctl(fd, SNIOC_GET_USTATE, (unsigned long)(uintptr_t)&tmp);
253253
if (ret < 0)
254254
{
255255
return ret;
256256
}
257257

258-
*interval = tmp.min_interval;
258+
*interval = tmp.interval;
259259
return ret;
260260
}
261261

@@ -276,16 +276,16 @@ int orb_set_batch_interval(int fd, unsigned batch_interval)
276276

277277
int orb_get_batch_interval(int fd, FAR unsigned *batch_interval)
278278
{
279-
struct sensor_state_s tmp;
279+
struct sensor_ustate_s tmp;
280280
int ret;
281281

282-
ret = ioctl(fd, SNIOC_GET_STATE, (unsigned long)(uintptr_t)&tmp);
282+
ret = ioctl(fd, SNIOC_GET_USTATE, (unsigned long)(uintptr_t)&tmp);
283283
if (ret < 0)
284284
{
285285
return ret;
286286
}
287287

288-
*batch_interval = tmp.min_latency;
288+
*batch_interval = tmp.latency;
289289
return ret;
290290
}
291291

@@ -367,4 +367,4 @@ int orb_fprintf(FAR FILE *stream, FAR const char *format,
367367
lib_stdoutstream(&stdoutstream, stream);
368368
return lib_bsprintf(&stdoutstream.common, format, data);
369369
}
370-
#endif
370+
#endif

0 commit comments

Comments
 (0)