diff --git a/drivers/sensors/fakesensor_uorb.c b/drivers/sensors/fakesensor_uorb.c index ef8e50fad1307..843347b6adf89 100644 --- a/drivers/sensors/fakesensor_uorb.c +++ b/drivers/sensors/fakesensor_uorb.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -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 */ @@ -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 {