10-26-2012 01:04 PM
When I build the following:
sensor_info(SENSOR_TYPE_GYROSCOPE, &sensorinfo);
mingyro=sensor_info_get_range_minimum(sensorinfo);
maxgyro=sensor_info_get_range_maximum(sensorinfo);
a build error is reported
called object sensor_info_get_range_maximum is not a function
As far as I can tell it is defined the same as the sensor_info_get_range_minimum in sensor.h
the sensor_info_get_range_minimum works fine (well, it returns a value with no build error. I can't actually verify if the reported value means anything...).
Am I missing something or id this a bug?
Solved! Go to Solution.
10-27-2012 08:30 AM
I'm not sure why you're having a problem.
I used the following code:
float information;
unsigned int informationi;
sensor_info_t *info = NULL;
sensor_info(SENSOR_TYPE_GYROSCOPE, &info);
if (info){
information = sensor_info_get_range_maximum(info);
printf("Max_Range = %f\n", information);
information = sensor_info_get_resolution(info);
printf("Resolution = %f\n", information);
information = sensor_info_get_range_minimum(info);
printf("Min_Range = %f\n", information);
informationi = sensor_info_get_delay_mininum(info);
printf("Min_Delay = %d\n", informationi);
informationi = sensor_info_get_delay_maximum(info);
printf("Max_Delay = %d\n", informationi);
informationi = sensor_info_get_delay_default(info);
printf("Default_Delay = %d\n", informationi);
information = sensor_info_get_power(info);
printf("Power = %f\n", information);
sensor_info_destroy(info);
fflush(stdout);
}
and got the following results:
Max_Range = 1000.000000
Resolution = 0.000000
Min_Range = -1000.000000
Min_Delay = 10000
Max_Delay = 256000
Default_Delay = 20000
Power = -1.000000
The only problem I've encountered was the spelling of sensor_info_get_delay_mininum.
It would throw an error when I spelled minimum correctly. I had to go to the header file to note the incorrect spelling and use it in my code.
BTW I'm using version 2.0.0 of the IDE.
10-27-2012 11:15 AM
I am running IDE 2.1.0 Build id: 201206041807
in sensor.h the declarations are:
BPS_API float sensor_info_get_range_minimum(sensor_info_t *info);
BPS_API float sensor_info_get_range_maximum(sensor_info_t *info);
I even cut/paste the name directly from sensor.h into my code and I still get the build error.
10-27-2012 11:37 AM
Very strange. Do the other sensor_info functions compile and work?
10-31-2012 05:36 PM
Never mind.
I found a problem further back in the code that was redefining sensor_info_get_range_maximum.
My Bad.
11-01-2012 11:04 AM
Hi mmd12,
Thanks for pointing out the typo, we are getting it fixed.
11-01-2012 11:12 AM
aparco,
So, you're going to make me change my code?
Well, OK.
![]()
11-01-2012 11:15 AM
mmd12, we would never do that
We will deprecate the function containing the typo and introduce a new function without the typo. No code changes will be requied on your end.