Skip to content

Commit

Permalink
sensors/fakesensor_uorb: Using different nbuffer for each topic of GNSS
Browse files Browse the repository at this point in the history
Signed-off-by: wangjianyu3 <[email protected]>
  • Loading branch information
JianyuWang0623 committed Nov 30, 2024
1 parent 8039963 commit 6ff1770
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/sensors/fakesensor_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <sys/param.h>

#include <nuttx/fs/fs.h>
#include <nuttx/kmalloc.h>
Expand Down Expand Up @@ -401,6 +402,14 @@ int fakesensor_init(int type, FAR const char *file_name,
FAR struct fakesensor_s *sensor;
FAR char *argv[2];
char arg1[32];
uint32_t nbuffer[] = {
[SENSOR_GNSS_IDX_GNSS] = batch_number,
[SENSOR_GNSS_IDX_GNSS_SATELLITE] = batch_number,
[SENSOR_GNSS_IDX_GNSS_MEASUREMENT] = batch_number,
[SENSOR_GNSS_IDX_GNSS_CLOCK] = batch_number,
[SENSOR_GNSS_IDX_GNSS_GEOFENCE] = batch_number,
};

int ret;

/* Alloc memory for sensor */
Expand Down Expand Up @@ -436,7 +445,7 @@ int fakesensor_init(int type, FAR const char *file_name,
if (type == SENSOR_TYPE_GNSS || type == SENSOR_TYPE_GNSS_SATELLITE)
{
sensor->gnss.ops = &g_fakegnss_ops;
gnss_register(&sensor->gnss, devno, batch_number);
gnss_register(&sensor->gnss, devno, nbuffer, nitems(nbuffer));
}
else
{
Expand Down

0 comments on commit 6ff1770

Please sign in to comment.