안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요.
이번에 안드로이 플랫폼에 sensor(가속도계) 포팅 하고 있습니다.
./hardware/libhardware/include/hardware/sensors.h 중 sensor_t 구조체 입니다.
struct sensor_t {
/* name of this sensors */
const char* name;
/* vendor of the hardware part */
const char* vendor;
/* version of the hardware part + driver. The value of this field is
* left to the implementation and doesn't have to be monotonically
* increasing.
*/
int version;
/* handle that identifies this sensors. This handle is used to activate
* and deactivate this sensor. The value of the handle must be 8 bits
* in this version of the API.
*/
int handle;
/* this sensor's type. */
int type;
/* maximaum range of this sensor's value in SI units */
float maxRange;
/* smallest difference between two values reported by this sensor */
float resolution;
/* rough estimate of this sensor's power consumption in mA */
float power;
/* minimum delay allowed between events in microseconds. A value of zero
* means that this sensor doesn't report events at a constant rate, but
* rather only when a new data is available */
int32_t minDelay;
/* reserved fields, must be zero */
void* reserved[8];
};
위 구조체 중 resolution;
값에 대한 문의 입니다.
여기에 어떤 값을 넣어 주어야 할지 도통 모르겠네요.
maxRange 를 예를 들면 현재 가속도 센서의 최대 표현 할 수 있는 맥시멈 값이라 이해했습니다.
즉, 가속도 센서가 +- 4G 까지 잡아 낼 수 있다면 , maxRange 값을 (9.8 * 4) 로 올려 주는 겁니다.
resolution 은 무엇을 뜻하는 것일까요? 단순히 해상도 라고 이해하기에는 잘 모르겠네요...
앱 개발자 분들이
함수를 통하여 받게 될 값일 것이라 추측 하고 있습니다.
이 값을 어떻게 활용 하시는지요?
감사합니다.



