Hi, Chinmay Thank you for your greate help. And I have another question, the framework will call the activate() in HAL when the first app register the listener, at this point, HAL can report the accel-values to framework, but another app register it's listener, the framework will not call the activate() again, so how can the HAL send the accel-values to framework (and framework will route it to the app)? 2011/1/12 Chinmay S <[email protected]>
> Hi, > > The setdelay() is a hint to the driver from the framework as to how > frequently it should report the events. > > > You can implement the following: > > 1. Pass the value to the driver using the sysfs/ioctls. (preferably SYSFS) > 2. Use interrupt-based functionality to updated a array of accel-values in > driver. > 3. Use timers/workqueues to generate input event in driver (at the delay > specified by setdelay(). > Pass the aacell-values array (which is always updated when needed by the > interrupt anyways) > > > Alternately to avoid all this you can set "0" in the resolution field in > the list of sensors (in HAL). > This basically means the accel-sensor is interrupt based and sends values > only when changed. > > Though the second solution might seem easier, do ensure that you report > atleast one set of values when intialised (i.e. a listener is registered), > which means that apps do get a working-set of data even if the device is > held constant and is not generating any events. > > > Regards > CVS > > -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting
